Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2057356imm; Sat, 28 Jul 2018 08:21:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHrc56K5ipftjHV9JwJtRdcjyEZag0llIHwzQvLwGPnWO5uDZ0YrRCNQ7tnYo/CIhA/UG8 X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr10314999pgs.203.1532791309912; Sat, 28 Jul 2018 08:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532791309; cv=none; d=google.com; s=arc-20160816; b=m1zHrnhSQMBWSxtD29Bkeb4o1VDrKvo2znuV/msupoDITb8wqFyKrdntnTOjqCOoFg gWa+R/5Q+lkAj5FdwFoTb2/Zxt9AwWR3nxhYk716FcEc+kOKvbOGa24V9SJGN8VibWfx OtMGnygJm9uUlzxioMmc+zocUYQv77YUsd8MXacbmLs9NE9pIP3GrmCSX+6JFKL7J2hc UWuj40s9mbUFlsHzSpb2NJIEoDgCOP0JzfvfW+/uNJOyN1NE0juGtHOfkhzBXPV+T+Wr RUul+nPMep4OtUiQ7HhDkR4+liaHDu16eW3KZKrYPw84JbsQJzFrPXxnofzzBpj0we0X pPtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=i7bM9ggJkwTXNLzNm66r4vLeY21lyntUMfv1b8AlKNY=; b=xKmw9G5c4kwkWMQ/bO1jb3NKuMfaR+PJKNITeWSmFLv2yGST9znEYPJvbTedwAMn7w QqwYdGweorsKdSNaIvyDZFneujrmBC7cbc9C931tt0GCQVhV1/RawPKf91QlBj2/7xJw BcLxjdfbg2XzSKQXBr2lJro4yE6WXgJERgUivIez4bmgjDgJCdJWxAIp/TCh3wAq0+ZM nRIMR2zLxQWK5BbCkcrW0hMWA6+U6FQEXEeHYLJs/+eRVKa+tYRiRDOumPH8jsYS6m9C /SMGj+ai9wJ4Cb4njnKb7k8Hg8ZuizHWbDb/TkpsijFqa4USfMO2bReq2pDF+bJfxaj4 dVYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAVmN5Lj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9-v6si6523719pgg.330.2018.07.28.08.21.33; Sat, 28 Jul 2018 08:21:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAVmN5Lj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729083AbeG1QpO (ORCPT + 99 others); Sat, 28 Jul 2018 12:45:14 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37855 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728213AbeG1QpO (ORCPT ); Sat, 28 Jul 2018 12:45:14 -0400 Received: by mail-qt0-f194.google.com with SMTP id n6-v6so8074760qtl.4; Sat, 28 Jul 2018 08:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i7bM9ggJkwTXNLzNm66r4vLeY21lyntUMfv1b8AlKNY=; b=FAVmN5LjI5N9fe4xxpzLtz7uy4GHr2QWgBsTCLwGAoq4ntUNL5fbPGzb1bVUl/gspl yhslgSbHUt9GAGb9oW2dNs3IFI4H9ygfg1lbNXlq8Sf5mafW34z3AvYGODDECb192NnD EpM23JtXXY+kxcCBaHwVov5JgyBqid1HCmlNCS0/Fx9LLWH2Gtu/VPmLj7WKqOO6pGny aF9+D3wHFByKo7/ppX3rnr+O+DGCnbAyC3gQgGoyp53OS+l74S1eS3fdZe976s638FeQ D/uf9/dsOCLIrFPFXFnxSavv0/6yDdjVQGBVBBrCupKu/EB6czwGw6Na/OQX2jOjbU6s +txA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i7bM9ggJkwTXNLzNm66r4vLeY21lyntUMfv1b8AlKNY=; b=pifpn0lcGuOVm850sQSW7T0RdfvONQaH3V9hizgetIKGJmlN2ApKbzmM1tTh9hTKoo IJUPK6lef/RSKM7apHqoYoun2tb0xJ7nTnMhp9xvwljOLIi0LYoemS5DWB6e9ECX4Uw5 K1SchKRyyrP/BZJ/YQoK89EvBcXkYOIt0xFHhFoQ4gQb/Dy9B5ko22Kp3W5z/Pi0OYw+ ZPe8iPNmSS0BfaNvFC0gPGs0AQHhezDnTYZZ52BY6kJBGesxBmCmnK8z0cUry9cZRxlo P2+s96C+VQy3oL6/ZooMwVjp5zw4crsFw2q+dBCnwGQv6dEbENxhpzThGk1PnQyOYTj1 oBgA== X-Gm-Message-State: AOUpUlGCu8VCHF1a1j5LAoL29oJmfzTw5RupqPehNcXc+nL62r/VxWqu GLr9BvIZLJdRU7fqFYtyM5c0TXS3zUwG8/a0V2M= X-Received: by 2002:ac8:354e:: with SMTP id z14-v6mr10602339qtb.261.1532791101821; Sat, 28 Jul 2018 08:18:21 -0700 (PDT) MIME-Version: 1.0 References: <20180727135157.13051-1-vasilyev@ispras.ru> In-Reply-To: From: Anton Vasilyev Date: Sat, 28 Jul 2018 18:18:10 +0300 Message-ID: Subject: Re: [PATCH] scsi: 3ware: fix return 0 on the error path of probe To: adam radford Cc: vasilyev@ispras.ru, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi , linux-kernel , ldv-project@linuxtesting.org Content-Type: multipart/alternative; boundary="0000000000002396e9057210bd4c" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000002396e9057210bd4c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Adam, 3w-9xxx: twa_probe(): There is check of retval: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/scsi/3w-9xxx.c#n2010 retval without assignement is 0 on fail of twa_initialize_device_ extension(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/scsi/3w-9xxx.c#n2040 And this 0 is returned from probe on the error path. Same pattern is true for all other cases from patch. -Anton 27 =D0=B8=D1=8E=D0=BB. 2018 =D0=B3. 9:42 =D0=9F=D0=9F =D0=BF=D0=BE=D0=BB=D1= =8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "adam radford" =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: On Fri, Jul 27, 2018 at 6:52 AM Anton Vasilyev wrote: > > tw_probe() returns 0 in case of fail of tw_initialize_device_extension(), > pci_resource_start() or tw_reset_sequence() and releases resources. > twl_probe() returns 0 in case of fail of twl_initialize_device_extension(), > pci_iomap() and twl_reset_sequence(). > twa_probe() returns 0 in case of fail of tw_initialize_device_extension()= , > ioremap() and twa_reset_sequence(). > > > The patch adds retval initialization for these cases. > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Anton Vasilyev > --- > drivers/scsi/3w-9xxx.c | 6 +++++- > drivers/scsi/3w-sas.c | 3 +++ > drivers/scsi/3w-xxxx.c | 2 ++ > 3 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c > index 99ba4a770406..27521fc3ef5a 100644 > --- a/drivers/scsi/3w-9xxx.c > +++ b/drivers/scsi/3w-9xxx.c > @@ -2038,6 +2038,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > > if (twa_initialize_device_extension(tw_dev)) { > TW_PRINTK(tw_dev->host, TW_DRIVER, 0x25, "Failed to initialize device extension"); > + retval =3D -ENOMEM; > goto out_free_device_extension; > } > > @@ -2060,6 +2061,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > tw_dev->base_addr =3D ioremap(mem_addr, mem_len); > if (!tw_dev->base_addr) { > TW_PRINTK(tw_dev->host, TW_DRIVER, 0x35, "Failed to ioremap"); > + retval =3D -ENOMEM; > goto out_release_mem_region; > } > > @@ -2067,8 +2069,10 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > TW_DISABLE_INTERRUPTS(tw_dev); > > /* Initialize the card */ > - if (twa_reset_sequence(tw_dev, 0)) > + if (twa_reset_sequence(tw_dev, 0)) { > + retval =3D -ENOMEM; > goto out_iounmap; > + } > > /* Set host specific parameters */ > if ((pdev->device =3D=3D PCI_DEVICE_ID_3WARE_9650SE) || > diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c > index cf9f2a09b47d..40c1e6e64f58 100644 > --- a/drivers/scsi/3w-sas.c > +++ b/drivers/scsi/3w-sas.c > @@ -1594,6 +1594,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > > if (twl_initialize_device_extension(tw_dev)) { > TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Failed to initialize device extension"); > + retval =3D -ENOMEM; > goto out_free_device_extension; > } > > @@ -1608,6 +1609,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > tw_dev->base_addr =3D pci_iomap(pdev, 1, 0); > if (!tw_dev->base_addr) { > TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to ioremap"); > + retval =3D -ENOMEM; > goto out_release_mem_region; > } > > @@ -1617,6 +1619,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > /* Initialize the card */ > if (twl_reset_sequence(tw_dev, 0)) { > TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1d, "Controller reset failed during probe"); > + retval =3D -ENOMEM; > goto out_iounmap; > } > > diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c > index f6179e3d6953..961ea6f7def8 100644 > --- a/drivers/scsi/3w-xxxx.c > +++ b/drivers/scsi/3w-xxxx.c > @@ -2280,6 +2280,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > > if (tw_initialize_device_extension(tw_dev)) { > printk(KERN_WARNING "3w-xxxx: Failed to initialize device extension."); > + retval =3D -ENOMEM; > goto out_free_device_extension; > } > > @@ -2294,6 +2295,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) > tw_dev->base_addr =3D pci_resource_start(pdev, 0); > if (!tw_dev->base_addr) { > printk(KERN_WARNING "3w-xxxx: Failed to get io address.")= ; > + retval =3D -ENOMEM; > goto out_release_mem_region; > } > > -- > 2.18.0 > Anton, 3w-9xxx: twa_probe() initializes retval at the top of the function: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/scsi/3w-9xxx.c#n2007 so does 3w-xxxx: tw_probe(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/scsi/3w-xxxx.c#n2253 so does 3w-sas: twl_probe(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/scsi/3w-sas.c#n1562 so I think your patch isn't needed... -Adam --0000000000002396e9057210bd4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Adam,

3w-9xxx: twa_probe():

There is check of= retval:

retval without assignement is 0 on fa= il of=C2=A0twa_initialize_device_extension():

And this 0 is returned from probe on the error path.=

Same pattern is true for all other case= s from patch.

<= /font>
-Anton

27 =D0= =B8=D1=8E=D0=BB. 2018 =D0=B3. 9:42 =D0=9F=D0=9F =D0=BF=D0=BE=D0=BB=D1=8C=D0= =B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "adam radford" <= aradford@gmail.com> =D0= =BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
On Fri, Jul 27, 2018 at 6:52 AM Anton Vasi= lyev <vasilyev@is= pras.ru> wrote:
>
> tw_probe() returns 0 in case of fail of tw_initialize_device_extension= (),
> pci_resource_start() or tw_reset_sequence() and releases resources. > twl_probe() returns 0 in case of fail of twl_initialize_device_extensi= on(),
> pci_iomap() and twl_reset_sequence().
> twa_probe() returns 0 in case of fail of tw_initialize_device_extensio= n(),
> ioremap() and twa_reset_sequence().
>
>
> The patch adds retval initialization for these cases.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
> ---
>=C2=A0 drivers/scsi/3w-9xxx.c | 6 +++++-
>=C2=A0 drivers/scsi/3w-sas.c=C2=A0 | 3 +++
>=C2=A0 drivers/scsi/3w-xxxx.c | 2 ++
>=C2=A0 3 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
> index 99ba4a770406..27521fc3ef5a 100644
> --- a/drivers/scsi/3w-9xxx.c
> +++ b/drivers/scsi/3w-9xxx.c
> @@ -2038,6 +2038,7 @@ static int twa_probe(struct pci_dev *pdev, const= struct pci_device_id *dev_id)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (twa_initialize_device_extension(t= w_dev)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_PRINTK= (tw_dev->host, TW_DRIVER, 0x25, "Failed to initialize device extens= ion");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= free_device_extension;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> @@ -2060,6 +2061,7 @@ static int twa_probe(struct pci_dev *pdev, const= struct pci_device_id *dev_id)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tw_dev->base_addr =3D ioremap(mem_= addr, mem_len);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!tw_dev->base_addr) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_PRINTK= (tw_dev->host, TW_DRIVER, 0x35, "Failed to ioremap");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= release_mem_region;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> @@ -2067,8 +2069,10 @@ static int twa_probe(struct pci_dev *pdev, cons= t struct pci_device_id *dev_id)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_DISABLE_INTERRUPTS(tw_dev);
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Initialize the card */
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0if (twa_reset_sequence(tw_dev, 0))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (twa_reset_sequence(tw_dev, 0)) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= iounmap;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Set host specific parameters */ >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((pdev->device =3D=3D PCI_DEVIC= E_ID_3WARE_9650SE) ||
> diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
> index cf9f2a09b47d..40c1e6e64f58 100644
> --- a/drivers/scsi/3w-sas.c
> +++ b/drivers/scsi/3w-sas.c
> @@ -1594,6 +1594,7 @@ static int twl_probe(struct pci_dev *pdev, const= struct pci_device_id *dev_id)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (twl_initialize_device_extension(t= w_dev)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_PRINTK= (tw_dev->host, TW_DRIVER, 0x1a, "Failed to initialize device extens= ion");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= free_device_extension;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> @@ -1608,6 +1609,7 @@ static int twl_probe(struct pci_dev *pdev, const= struct pci_device_id *dev_id)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tw_dev->base_addr =3D pci_iomap(pd= ev, 1, 0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!tw_dev->base_addr) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_PRINTK= (tw_dev->host, TW_DRIVER, 0x1c, "Failed to ioremap");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= release_mem_region;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> @@ -1617,6 +1619,7 @@ static int twl_probe(struct pci_dev *pdev, const= struct pci_device_id *dev_id)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Initialize the card */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (twl_reset_sequence(tw_dev, 0)) {<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TW_PRINTK= (tw_dev->host, TW_DRIVER, 0x1d, "Controller reset failed during pro= be");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= iounmap;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
> index f6179e3d6953..961ea6f7def8 100644
> --- a/drivers/scsi/3w-xxxx.c
> +++ b/drivers/scsi/3w-xxxx.c
> @@ -2280,6 +2280,7 @@ static int tw_probe(struct pci_dev *pdev, const = struct pci_device_id *dev_id)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (tw_initialize_device_extension(tw= _dev)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KE= RN_WARNING "3w-xxxx: Failed to initialize device extension."); > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= free_device_extension;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> @@ -2294,6 +2295,7 @@ static int tw_probe(struct pci_dev *pdev, const = struct pci_device_id *dev_id)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tw_dev->base_addr =3D pci_resource= _start(pdev, 0);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!tw_dev->base_addr) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KE= RN_WARNING "3w-xxxx: Failed to get io address.");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retval =3D -EN= OMEM;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto out_= release_mem_region;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> --
> 2.18.0
>

Anton,

3w-9xxx: twa_probe() initializes retval at the top of the function:

https://g= it.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi= /3w-9xxx.c#n2007

so does 3w-xxxx: tw_probe():

https://g= it.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi= /3w-xxxx.c#n2253

so does 3w-sas: twl_probe():

https://gi= t.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/= 3w-sas.c#n1562

so I think your patch isn't needed...


-Adam

=
--0000000000002396e9057210bd4c--