From patchwork Fri May 4 11:48:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10380361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FB7E6037D for ; Fri, 4 May 2018 11:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD9329372 for ; Fri, 4 May 2018 11:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12A97293E1; Fri, 4 May 2018 11:48:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8637F29372 for ; Fri, 4 May 2018 11:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750880AbeEDLsm (ORCPT ); Fri, 4 May 2018 07:48:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:52025 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbeEDLsm (ORCPT ); Fri, 4 May 2018 07:48:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2C52FAF06; Fri, 4 May 2018 11:48:41 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH] qlogic_stub: Fixup NULL argument to host_reset() Date: Fri, 4 May 2018 13:48:38 +0200 Message-Id: <20180504114838.39646-1-hare@suse.de> X-Mailer: git-send-email 2.12.3 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PCMCIA stub calls host_reset() with a NULL argument, which is always wrong. So build a dummy scsi command to restore functionality. Fixes: 4a56c1c166b6: "scsi: qlogicfas: move bus_reset to host_reset" Reported-by: Dan Carpenter Signed-off-by: Hannes Reinecke --- drivers/scsi/pcmcia/qlogic_stub.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index 0556054764dc..6a3b71e3f351 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c @@ -254,6 +254,9 @@ static void qlogic_release(struct pcmcia_device *link) static int qlogic_resume(struct pcmcia_device *link) { scsi_info_t *info = link->priv; + /* Dummy command for host_reset function */ + struct scsi_cmnd scmd; + struct scsi_device sdev; pcmcia_enable_device(link); if ((info->manf_id == MANFID_MACNICA) || @@ -263,8 +266,10 @@ static int qlogic_resume(struct pcmcia_device *link) outb(0x24, link->resource[0]->start + 0x9); outb(0x04, link->resource[0]->start + 0xd); } - /* Ugggglllyyyy!!! */ - qlogicfas408_host_reset(NULL); + sdev.host = info->host; + scmd->device = &sdev; + + qlogicfas408_host_reset(scmd); return 0; }