Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp507738pxj; Wed, 2 Jun 2021 04:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlVo8iEvtrqQJo1Tqb6jx3eWEQtos87taAM3PgSlpbUh5ZaP/RdcH/0bmeF8izI4XY7Qfj X-Received: by 2002:a05:6e02:1d0b:: with SMTP id i11mr25642812ila.36.1622634931869; Wed, 02 Jun 2021 04:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622634931; cv=none; d=google.com; s=arc-20160816; b=YPmwpN5rb7YCKsoyjsrjOToeZNj1ax4VcCn0zjxuj8O59lLmi/n6hkyaKKf0pho1hz d0kyknn04hz1FHN2ZBctBxCgH2ITX29w3KRe1YCRav1IcSMCNKiTmQTT0Lni9erqyP2o ZLkxWiCONsM3r/g76LM1Wc0B5bx8gNGGdCnHj9BfuoCtgPedJZMWD1HZpcrMeOknshQ6 5XZsQbwr29mEpXbse8w+cHqgfdVOnCvUx2vMxkp3PNvpeiDr/yhTt32IVfnCjipmZYnL xdvqT+ZZSQBMvbTr4blhEBHNkOWRgEhwPQjjGnyTfmOkPkRTW+fon6tQ/xtV5ZQPk6PV TjAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=g93BppBQuxCnKeC/qo/b+OtaChd6KyUmeCqQ4Di1e9Y=; b=qw1xt+lcYo1PMr3OqUWcF5sO5vwRw/eh7o5Dx8MjB6Tts+VlQRoolRTYBcFerBba93 05RFr/MCGO+v15QuPOXGycmh/yUPg7FSOtguqN6hwwi2KTgapYLUwOifodqYNQwlMBrs 7CwWOyT9AGdUwBl+zjSZp6PATKEiMN3DYsADZ1fmJRAsChucPKuqOpLYbMLbPHAfMIzf /l4et0BKvqOha0Y5N5/6bdcgnz6WgW4wLe8Z3GTCz/UJLuzbS5ZrbbMQkjxbnpJezywN axaXqAXvSxnZIJ5+tHaUcU7DlXiegTN3pwHY5vJnorusPf2ycRoroYfvER02608R6aXn duCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si17248932ilo.160.2021.06.02.04.55.19; Wed, 02 Jun 2021 04:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbhFBKEu (ORCPT + 99 others); Wed, 2 Jun 2021 06:04:50 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:55187 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbhFBKEr (ORCPT ); Wed, 2 Jun 2021 06:04:47 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R621e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Ub2X3Cs_1622628181; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Ub2X3Cs_1622628181) by smtp.aliyun-inc.com(127.0.0.1); Wed, 02 Jun 2021 18:03:03 +0800 From: Yang Li 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 Subject: [PATCH] scsi: 3ware: fix return 0 on the error path of probe Date: Wed, 2 Jun 2021 18:02:56 +0800 Message-Id: <1622628176-84924-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Yang Li --- 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