Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6711513rwb; Tue, 15 Nov 2022 02:36:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf67rDgX21eJM9zF7RsTavJ4mTrzAGZgMRAg6Y68brqoiWj4Lpc4+VS7IXTF0TPsUl3RRSpP X-Received: by 2002:a65:664a:0:b0:470:4f30:6d80 with SMTP id z10-20020a65664a000000b004704f306d80mr15333581pgv.285.1668508569365; Tue, 15 Nov 2022 02:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668508569; cv=none; d=google.com; s=arc-20160816; b=trv9/CJanvy+t14+Qwniojo2HZGIOyq6aemI0kJlmtj5kdZA3FpRMuXQWu4a3RkJjV IjlNT5xVSeag8c6rL17ahEt3kcZFlBGqTb0wz/M6SHf1D6b22fOJjM3xnrM6WpCG78GB 7ZhYe4btEYjLjJT9teSWE0ANgoha0gCRZTFRgpXqrM5N0LGmT8bZYOpgzgrPFvyGQOHr ZEBl32JgHRAs4tGH2+ticRY07PmA1YUDZXa7XdPnhNb1pQXO3wqH8nH14wB/nIzYR3d0 VtmfrCuOlBcXcUAjgMWHCRwGHtRwXYJ7N5KsUYAJNBatLvDbHkYDR/V+hoP66JbYkjP3 kW0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WyR9RdzF47Mc2cwew/z92Lbra+oLzJgiwxbIVABBUCQ=; b=ic6EOr/JgipWRWBJwwb3zCI0+6x9GbOE7XIvjQcGiwrkOhStZX5vv8HLG+Vl51K1KS oinNUJ6Vndkh7WaAu7jCsOfMKN+kNkT1frZiAZzv2WGKxOrqS73JrHNDTqSOWKNnpXzN 3whHkzo7AyuBPdvnv9QRc9nnsqJ0NaXG3L/nOJfYhPn59YjurXnZw4Y7Sk9akd1n7XW1 ophUtHtRNC5o+KjsSnUDR5iYBr4DE5WdX+x8qlEHv3HG8LuVGnHri187oohI4hYcT/6v xX9Jj4RM5hfs6cCQ5nypFQKenTcWZFc8w7tBgHjb8VCmtDP0rTyQoyT3eusxMp9PiIv0 whAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=DM5vR0OJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a170902b41300b001871e838ba9si11170357plr.344.2022.11.15.02.35.57; Tue, 15 Nov 2022 02:36:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=DM5vR0OJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238081AbiKOK1D (ORCPT + 90 others); Tue, 15 Nov 2022 05:27:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiKOK1B (ORCPT ); Tue, 15 Nov 2022 05:27:01 -0500 X-Greylist: delayed 427 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 15 Nov 2022 02:26:57 PST Received: from forward107j.mail.yandex.net (forward107j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::252]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1922011C36; Tue, 15 Nov 2022 02:26:56 -0800 (PST) Received: from myt6-bd59def10a3e.qloud-c.yandex.net (myt6-bd59def10a3e.qloud-c.yandex.net [IPv6:2a02:6b8:c12:2487:0:640:bd59:def1]) by forward107j.mail.yandex.net (Yandex) with ESMTP id 0FF6E884C30; Tue, 15 Nov 2022 13:19:48 +0300 (MSK) Received: by myt6-bd59def10a3e.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id AlCOAl4E1M-JkV4efNG; Tue, 15 Nov 2022 13:19:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1668507587; bh=WyR9RdzF47Mc2cwew/z92Lbra+oLzJgiwxbIVABBUCQ=; h=Message-Id:Date:Cc:Subject:To:From; b=DM5vR0OJd6y0MFkLA4eLT5yI2IqOgaTdtcHbbiJchDEYyjkQ38RxEOpHaX4Rsu+MA r2zpz6eSmqCGpzM3ZnOEIaIsPCwPdOOkxO6l8XaqgOMYO6jgz5oGHPGlb+RsshYAF9 HxeI+jRCdvd5w24tpHckc/rm5WhvY8cGmRBpNoXo= Authentication-Results: myt6-bd59def10a3e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: Peter Kosyh To: Don Brace Cc: Peter Kosyh , "James E.J. Bottomley" , "Martin K. Petersen" , storagedev@microchip.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] scsi: hpsa: check retval of hpsa_scsi_do_simple_cmd_with_retry() Date: Tue, 15 Nov 2022 13:19:42 +0300 Message-Id: <20221115101942.161971-1-pkosyh@yandex.ru> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only place where retval of hpsa_scsi_do_simple_cmd_with_retry() is not checked. Add check for retval. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Peter Kosyh --- drivers/scsi/hpsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f8e832b1bc46..21c3e33bffde 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3424,8 +3424,10 @@ static int hpsa_bmic_id_physical_device(struct ctlr_info *h, c->Request.CDB[2] = bmic_device_index & 0xff; c->Request.CDB[9] = (bmic_device_index >> 8) & 0xff; - hpsa_scsi_do_simple_cmd_with_retry(h, c, DMA_FROM_DEVICE, + rc = hpsa_scsi_do_simple_cmd_with_retry(h, c, DMA_FROM_DEVICE, NO_TIMEOUT); + if (rc) + goto out; ei = c->err_info; if (ei->CommandStatus != 0 && ei->CommandStatus != CMD_DATA_UNDERRUN) { hpsa_scsi_interpret_error(h, c); -- 2.38.1