From patchwork Fri Nov 1 11:18:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 11222907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AE1417E6 for ; Fri, 1 Nov 2019 11:18:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68A912086D for ; Fri, 1 Nov 2019 11:18:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730361AbfKALSn (ORCPT ); Fri, 1 Nov 2019 07:18:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:34748 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730201AbfKALSm (ORCPT ); Fri, 1 Nov 2019 07:18:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0FD96B2C6; Fri, 1 Nov 2019 11:18:41 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCH 2/4] dpt_i2o: make adpt_i2o_to_scsi() a void function Date: Fri, 1 Nov 2019 12:18:36 +0100 Message-Id: <20191101111838.140027-3-hare@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191101111838.140027-1-hare@suse.de> References: <20191101111838.140027-1-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The return value is never used anywhere, and returning it risks a use-after-free crash. Signed-off-by: Hannes Reinecke --- drivers/scsi/dpt_i2o.c | 3 +-- drivers/scsi/dpti.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index cf0851563f57..9fc3bb53880f 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -2340,7 +2340,7 @@ static s32 adpt_scsi_host_alloc(adpt_hba* pHba, struct scsi_host_template *sht) } -static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) +static void adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) { adpt_hba* pHba; u32 hba_status; @@ -2458,7 +2458,6 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) if(cmd->scsi_done != NULL){ cmd->scsi_done(cmd); } - return cmd->result; } diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h index 42b1e28b5884..1f344a2ac0f5 100644 --- a/drivers/scsi/dpti.h +++ b/drivers/scsi/dpti.h @@ -286,7 +286,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba); static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba); static s32 adpt_i2o_hrt_get(adpt_hba* pHba); static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice); -static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd); +static void adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd); static s32 adpt_scsi_host_alloc(adpt_hba* pHba,struct scsi_host_template * sht); static s32 adpt_hba_reset(adpt_hba* pHba); static s32 adpt_i2o_reset_hba(adpt_hba* pHba);