Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932679AbcCCSBS (ORCPT ); Thu, 3 Mar 2016 13:01:18 -0500 Received: from mail1.bemta12.messagelabs.com ([216.82.251.3]:30197 "EHLO mail1.bemta12.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932444AbcCCSBR (ORCPT ); Thu, 3 Mar 2016 13:01:17 -0500 X-Env-Sender: David.Kershner@unisys.com X-Msg-Ref: server-9.tower-164.messagelabs.com!1457028072!10983407!2 X-Originating-IP: [192.61.61.105] X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked From: David Kershner To: , , , CC: David Kershner Subject: [PATCH] staging: unisys: visorbus: variable adjustment should be a u64 Date: Thu, 3 Mar 2016 13:00:38 -0500 Message-ID: <1457028038-547-1-git-send-email-david.kershner@unisys.com> X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 03 Mar 2016 18:01:10.0619 (UTC) FILETIME=[AB03AAB0:01D17576] MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 933 Lines: 27 This patch fixes the smatch error: drivers/staging/unisys/visorbus/visorchipset.c:2217 visorchipset_ioctl() warn: user controlled 'adjustment' cast to postive rl = 's64min-s64max' This is because we read a s64 and pass it to a function as u64. Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 5515845..5fbda7b 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -2248,7 +2248,7 @@ static inline int issue_vmcall_update_physical_time(u64 adjustment) static long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - s64 adjustment; + u64 adjustment; s64 vrtc_offset; switch (cmd) { -- 1.9.1