From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754057AbdBGLxF (ORCPT ); Tue, 7 Feb 2017 06:53:05 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:46527 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbdBGLxE (ORCPT ); Tue, 7 Feb 2017 06:53:04 -0500 From: Colin King To: Adaptec OEM Raid Solutions , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][V2] scsi: aacraid: rcode is unsigned and should be signed int Date: Tue, 7 Feb 2017 11:51:29 +0000 Message-Id: <20170207115129.18948-1-colin.king@canonical.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King aac_fib_send can return -ve error returns and hence rcode should be signed. Currently the rcode >= 0 check is always true and -ve errors are not being checked. Thanks to Dan Carpenter for spotting my original broken fix to this issue. Signed-off-by: Colin Ian King --- drivers/scsi/aacraid/aachba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 3b5ddf4..907f1e8 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1798,7 +1798,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan) struct sgmap64 *sg64; dma_addr_t addr; u32 vbus, vid; - u32 rcode = 0; + int rcode = 0; /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) -- 2.10.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Colin King Date: Tue, 07 Feb 2017 11:51:29 +0000 Subject: [PATCH][V2] scsi: aacraid: rcode is unsigned and should be signed int Message-Id: <20170207115129.18948-1-colin.king@canonical.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Adaptec OEM Raid Solutions , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Colin Ian King aac_fib_send can return -ve error returns and hence rcode should be signed. Currently the rcode >= 0 check is always true and -ve errors are not being checked. Thanks to Dan Carpenter for spotting my original broken fix to this issue. Signed-off-by: Colin Ian King --- drivers/scsi/aacraid/aachba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 3b5ddf4..907f1e8 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1798,7 +1798,7 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan) struct sgmap64 *sg64; dma_addr_t addr; u32 vbus, vid; - u32 rcode = 0; + int rcode = 0; /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) -- 2.10.2