Skip to content

Commit 75e406b

Browse files
spandruvadajwrdegoede
authored andcommitted
platform/x86/intel-uncore-freq: Return error on write frequency
Currently when the uncore_write() returns error, it is silently ignored. Return error to user space when uncore_write() fails. Fixes: 49a474c ("platform/x86: Add support for Uncore frequency control") Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Wendy Wang <wendy.wang@intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230418153230.679094-1-srinivas.pandruvada@linux.intel.com Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 4a9b685 commit 75e406b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data,
4444
int min_max)
4545
{
4646
unsigned int input;
47+
int ret;
4748

4849
if (kstrtouint(buf, 10, &input))
4950
return -EINVAL;
5051

5152
mutex_lock(&uncore_lock);
52-
uncore_write(data, input, min_max);
53+
ret = uncore_write(data, input, min_max);
5354
mutex_unlock(&uncore_lock);
5455

56+
if (ret)
57+
return ret;
58+
5559
return count;
5660
}
5761

0 commit comments

Comments
 (0)