From patchwork Wed Mar 20 14:14:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangwenji X-Patchwork-Id: 10861781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2522F1708 for ; Wed, 20 Mar 2019 14:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0597B2886C for ; Wed, 20 Mar 2019 14:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0349429CBE; Wed, 20 Mar 2019 14:14:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A72942886C for ; Wed, 20 Mar 2019 14:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfCTOOr (ORCPT ); Wed, 20 Mar 2019 10:14:47 -0400 Received: from m12-17.163.com ([220.181.12.17]:60557 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfCTOOr (ORCPT ); Wed, 20 Mar 2019 10:14:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=CwoN4WwKycweTH8n8a 9aKZeq9hvHswoNmPm2bcNOILg=; b=JVQMuoZLdjWtO/IOGqwQYvJKB9PKskyjWw QWl2pEW1Mr9I6UQMObgSDGMXnRq310MhJeAqrxPDaCXR4t6rmHeuUAHJt4S7nB5G AdZ6RerUIa/Pemxf0+lpx32csd+K/HiTKwaFliVxDbhC70Hp8PCllEUanxixmE/5 AgkyVkpmw= Received: from localhost.localdomain (unknown [183.215.90.29]) by smtp13 (Coremail) with SMTP id EcCowADn1eLQSpJc_bDCLw--.52243S2; Wed, 20 Mar 2019 22:14:42 +0800 (CST) From: tangwenji To: "Martin K. Petersen" Cc: target-devel@vger.kernel.org, tangwenji Subject: [PATCH] target:iscsi:free conn_ops when zalloc_cpumask_var failed Date: Wed, 20 Mar 2019 22:14:44 +0800 Message-Id: <1553091284-4412-1-git-send-email-hndksztwj@163.com> X-Mailer: git-send-email 2.5.0.windows.1 X-CM-TRANSID: EcCowADn1eLQSpJc_bDCLw--.52243S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruFW3tw4DKF1DJw4ftF1DWrg_yoWDZrc_Cw 1Ygr12gr1jg34fAr4UCwn8Xr9Y93yrZa1IvFZ7t3yYyFW2gw1DGF4jqFna9ryUu3ykZr18 CwnrZrWfCwn5JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8Y9aPUUUUU== X-Originating-IP: [183.215.90.29] X-CM-SenderInfo: 5kqgy2h2wzyqqrwthudrp/1tbiERJ9Q1WBkyzVXAAAsf Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: tangwenji It should not free cpumask but free conn->conn_ops When zalloc_cpumask_var failed. Signed-off-by: tangwenji Reviewed-by: Mike Christie --- drivers/target/iscsi/iscsi_target_login.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index ae3209e..c3e1d40 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1159,13 +1159,13 @@ static struct iscsi_conn *iscsit_alloc_conn(struct iscsi_np *np) if (!zalloc_cpumask_var(&conn->conn_cpumask, GFP_KERNEL)) { pr_err("Unable to allocate conn->conn_cpumask\n"); - goto free_mask; + goto free_conn_ops; } return conn; -free_mask: - free_cpumask_var(conn->conn_cpumask); +free_conn_ops: + kfree(conn->conn_ops); put_transport: iscsit_put_transport(conn->conn_transport); free_conn: