[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ba5a2360-68b2-a3e6-c379-5122e698bfca@redhat.com>
Date: Tue, 20 Apr 2021 17:02:48 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: Colin King <colin.king@...onical.com>,
Rajneesh Bhardwaj <irenic.rajneesh@...il.com>,
David E Box <david.e.box@...el.com>,
Mark Gross <mgross@...ux.intel.com>,
platform-driver-x86@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] platform/x86: intel_pmc_core: fix unsigned variable
compared to less than zero
Hi Colin,
On 4/20/21 2:10 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> The check for ret < 0 is always false because ret is a (unsigned) size_t
> and not a (signed) ssize_t, hence simple_write_to_buffer failures are
> never detected. Fix this by making ret a ssize_t
>
> Addresses-Coverity: ("Unsigned compared against 0")
> Fixes: 8074a79fad2e ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Thank you for the patch, but I already send out the same patch myself
yesterday, so this is a duplicate.
Regards,
Hans
> ---
> drivers/platform/x86/intel_pmc_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c
> index 3ae00ac85c75..d174aeb492e0 100644
> --- a/drivers/platform/x86/intel_pmc_core.c
> +++ b/drivers/platform/x86/intel_pmc_core.c
> @@ -1360,7 +1360,7 @@ static ssize_t pmc_core_lpm_latch_mode_write(struct file *file,
> struct pmc_dev *pmcdev = s->private;
> bool clear = false, c10 = false;
> unsigned char buf[8];
> - size_t ret;
> + ssize_t ret;
> int idx, m, mode;
> u32 reg;
>
>
Powered by blists - more mailing lists