Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp324264ybb; Tue, 24 Mar 2020 23:55:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs5TNOWDKwfKeIKQhHVpX2AqE+t9j6R7r3CGvWxhfLwRFcftEJ0wlctYUL9N+ycJWyw90MK X-Received: by 2002:aca:b7c1:: with SMTP id h184mr1483250oif.77.1585119323719; Tue, 24 Mar 2020 23:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585119323; cv=none; d=google.com; s=arc-20160816; b=YfIPS5GNIZFGbxd7UOddka3fu2KQn8sb927PrhRSgv7r3XzrlA/Jr2RrlBQu+hQSEB EPv/zsBc+0UgyDEsSOYdYDiqRf3I99tlr8BCvz9v48qEqpkxck3EUXT8gfNdSfFtYMmU P4x9G7jwUhlfEKrZ2bIBUuCu9g0JTtwukCQ8gsCBbbO+c58dPp4idK4c9k5IQjpn+hu8 Ugukkxj6IVdHa8ShLG4u8MGwUMQnEpXvX9BRYwGFIgRoka/Cz/34PdfWRFCIlJDI1aY7 LYt1eKny9yGQNkAhuunRdMpggkaRaR67ufc565c+ZqOeDrjQg1VpPUHjt1c5DJfA07rx jL7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=Nj5pRZn50RaarFhVZYxr8YynMYISMAr7mGvhI7DEKYo=; b=z+rfsfYag0LXjszT/Ot5b785siHRrk8Nn6XewsmHvdC/4ZCrYObfryXuXoTYhbAjlT szS7sl4fc0+W1Bs35I2tMjUA/+P+4GBOG5NI2o2n1ITsyYx0c0o9eMuFv63C1kYt83rz OwKapJ8G7HWIj7I47CRWo4Mm06mk3shW3jWDwXn2GMZX3uWpBaMDxmqKVUez/9hi+SvN Q5BbpNOXihdfVftO/Puo9LQRkuRfbouPKPo7uHs3zGlxMgWPAqINwdt03D8Ch/yXJ8e5 KDSuqYxn7YBbU91/Sn+ML8YQlt4CxgnxKq/nvPq7GBMQx+3VNfARao0ojt5KqFKCJVDb 0+lg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si9672441ota.85.2020.03.24.23.55.11; Tue, 24 Mar 2020 23:55:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbgCYGxr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Mar 2020 02:53:47 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3046 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725781AbgCYGxq (ORCPT ); Wed, 25 Mar 2020 02:53:46 -0400 Received: from dggeml405-hub.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 4E5993D907617DFDD781; Wed, 25 Mar 2020 14:53:33 +0800 (CST) Received: from DGGEML423-HUB.china.huawei.com (10.1.199.40) by dggeml405-hub.china.huawei.com (10.3.17.49) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 25 Mar 2020 14:53:33 +0800 Received: from DGGEML525-MBS.china.huawei.com ([169.254.4.199]) by dggeml423-hub.china.huawei.com ([10.1.199.40]) with mapi id 14.03.0487.000; Wed, 25 Mar 2020 14:53:26 +0800 From: "wubo (T)" To: Lee Duncan , Chris Leech , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-scsi@vger.kernel.org" , "open-iscsi@googlegroups.com" , "linux-kernel@vger.kernel.org" CC: linfeilong , "liuzhiqiang (I)" Subject: [PATCH] scsi:libiscsi:Fix an error count for active session Thread-Topic: [PATCH] scsi:libiscsi:Fix an error count for active session Thread-Index: AdYCcb2iexxjeQOuRpOqeUuVmQcdfw== Date: Wed, 25 Mar 2020 06:53:25 +0000 Message-ID: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.173.221.252] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wu Bo Fix an error count for active session if the total_cmds is invalid on the function iscsi_session_setup(). decrement the number of active sessions before the func return. Signed-off-by: Wu Bo --- drivers/scsi/libiscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 70b99c0..b7158eb 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -2771,7 +2771,7 @@ struct iscsi_cls_session * "must be a power of 2.\n", total_cmds); total_cmds = rounddown_pow_of_two(total_cmds); if (total_cmds < ISCSI_TOTAL_CMDS_MIN) - return NULL; + goto dec_session_count; printk(KERN_INFO "iscsi: Rounding can_queue to %d.\n", total_cmds); } -- 1.8.3.1