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 <[email protected]> Reviewed-by: Zhang Rui <[email protected]> Tested-by: Wendy Wang <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 4a9b685 commit 75e406b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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)