All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Li <yang.lee@linux.alibaba.com>
To: jejb@linux.ibm.com
Cc: aradford@gmail.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH] scsi: 3ware: fix return 0 on the error path of probe
Date: Wed,  2 Jun 2021 18:02:56 +0800	[thread overview]
Message-ID: <1622628176-84924-1-git-send-email-yang.lee@linux.alibaba.com> (raw)

When tw_reset_sequence() failed and returns 1, the tw_probe() returns 
retval with a value of 0. We set retval to -ENOMEM in this case.

Clean up smatch warning:
drivers/scsi/3w-xxxx.c:2309 tw_probe() warn: missing error code
'retval'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/3w-xxxx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index a729288..6557663 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2305,8 +2305,10 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 	TW_DISABLE_INTERRUPTS(tw_dev);
 
 	/* Initialize the card */
-	if (tw_reset_sequence(tw_dev))
+	if (tw_reset_sequence(tw_dev)) {
+		retval = -ENOMEM;
 		goto out_release_mem_region;
+	}
 
 	/* Set host specific parameters */
 	host->max_id = TW_MAX_UNITS;
-- 
1.8.3.1


             reply	other threads:[~2021-06-02 10:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 10:02 Yang Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-27 13:51 [PATCH] scsi: 3ware: fix return 0 on the error path of probe Anton Vasilyev
2018-07-27 18:42 ` adam radford
2018-07-28 15:18   ` Anton Vasilyev
2018-07-30 18:31     ` adam radford
2018-07-31  2:08 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1622628176-84924-1-git-send-email-yang.lee@linux.alibaba.com \
    --to=yang.lee@linux.alibaba.com \
    --cc=aradford@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.