Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp818532lqa; Sun, 28 Apr 2024 05:54:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWh6pHbb1c4X0zaNNFY2cdhhkmFKzqh23WDfhV3R1gjM0JUjsXbJ0JT4yH0N+ukhz9+MDbRiBYBMR4v7gJYelqEpY/WDRyhsEF4YMEwpA== X-Google-Smtp-Source: AGHT+IHDXlE7HXn/whxJxHcDRrr4LxGrewdZlxEdceWrBcJQYN8fayB51HvD/HwdHIJ7ExF0iX2k X-Received: by 2002:ad4:5764:0:b0:6a0:76d8:e79a with SMTP id r4-20020ad45764000000b006a076d8e79amr8964964qvx.19.1714308851461; Sun, 28 Apr 2024 05:54:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714308851; cv=pass; d=google.com; s=arc-20160816; b=jUk5/NELdlU/OVnWBy7i+nDS0khWAOXU/a/e7FaDXtfoC+nrW82wIbpA72GflLDBFN uIGRIg4tDSNHu6/WR2bpWlhVQNm1cKzRSXPk9Slg8o18pBKRkIwglE5dY1eYYkTrkjSS 4nw+eXZDFRCeLRlgLXZsdq9uKXI6ag1rAuOxmuoYQCsgPbR0oJmjq9AJqYs/cntC2IKQ jpVkhbx13o7lk7kFwW0b3bzp0Td3Q5F6vuNpzPX3/hhXQTIhzP9Ha74FohUUqZcu521m /5u0S9tewh2G77KmaMkVnCN3tOyFQk2hkuoGuBsearYUG562WYiyRzkpvetkbOrpmHvB Mfkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=pytEz1hBiZhR3/33BHamZLo8u9WQHaEHaKOnyS1MB/I=; fh=Y68weyBY5qjKly5YssEVh+y9vHTj3GlETrGsv/+YvMI=; b=RwW8kDKWQBCrBesoUyo3v62Xtu6rLzFW2AsqHe4FZVahb0vWTBrtUalpCH/RsOfvzm HwMn3AlH45ugsGzbN1bjEXWG+k6dsYEwYghlxj1Ul0R0MF5dwnzCirBaCBgMkF0F9jlw 3v9K3qjvvM01yOtfzH11SDJVUNYzO9uvl5U55mLAckLwwNYb5DfZThcFo0fsswkRSHn/ vlDq2yG2t/RVj6PmmksrhmWfWnQy/VCrzLpRA+3CrZp+lz9ScDTDosQwv3S6nkFQ62bh KSLIrDSAgils/iT+ovf3J2cAZlNwHwn9BUwgYXJLVobbUDVDKAD1b4Kr1EO4yN0R6B+2 Nq7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=WBlpdREm; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-161427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gs1-20020a056214226100b006a0cb8130easi799512qvb.467.2024.04.28.05.54.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 05:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=WBlpdREm; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-161427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 35B251C20B55 for ; Sun, 28 Apr 2024 12:54:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 533E66BB58; Sun, 28 Apr 2024 12:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="WBlpdREm" Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DE14F516; Sun, 28 Apr 2024 12:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714308838; cv=none; b=F7oU5BJWCCgKSVlWAbDTs49piKTj9OGVoC/nG1Bb41G+4fvWMTzPQUB8asmGwHSbvbxlKk/0AgN2dIb/fwhzNNlSMbbLALvih2l9LWuRZlyM0zXVp2xGPVlE7n3UsazR887r+siVdXQtd1DugN5/nAjExLjCg4n19FJISZp+Up8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714308838; c=relaxed/simple; bh=PObusAyonphNfE4wWT8tWyu3dftMdnrVBH0CtYfXnJg=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=WgpijFVrsksqjEy30FESAicRUdFoyeZgE9hQA5w2RdV2xmommGXLhzkltcgQ13ZtxharNrBbK71O8Pn4jC7hO1D5tOqCiRi/V4R6wN/33uiAz2yVVs92SnywqDo1uN3TmRuOCyMPmjMXA1QlU7cKJmpQlclf6TrFDFh8ETOVqNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=WBlpdREm; arc=none smtp.client-ip=212.227.15.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1714308807; x=1714913607; i=markus.elfring@web.de; bh=pytEz1hBiZhR3/33BHamZLo8u9WQHaEHaKOnyS1MB/I=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:From:Subject:To: Cc:References:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=WBlpdREmeF8bEmsXc1pVzXOmwVopIrJtx64k5WaQHpGZD3WbfVqZ911KXlC9IZ3l Y/f1g9xytio8pm6LpbBr57gcCk8relXRPyYE5+AUQkeYV9Dya5OhFAQ6GTQrQFtEA IsZfQ8P+MYqCXUkx8jdQ+GWKcEPIHBQsGknXbi5gUPaolhzTZJyEhYiYk/Zoap4Ex kyvuYMfxjzlePs/99nr/xlgHEu8WOiOadKjsciR+XFe+yUSAp4mbZBEQREwx49KUE GOKRt9T/Kop1DqKRU+lfcTKj9MncgqqCTnSWrUqd6oCrbo3Rvbm+1i1iEpNA7k8e3 pTRnJvTthas0RUYrcA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnX5F-1sQo0g1qab-00e9OP; Sun, 28 Apr 2024 14:53:27 +0200 Message-ID: <63caf898-8072-48fe-ba7a-2e10e5b2d8ab@web.de> Date: Sun, 28 Apr 2024 14:52:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Markus Elfring Subject: Re: [PATCH V2] scsi: qla2xxx: Fix double free of fcport in error handling path To: Yongzhi Liu , GR-QLogic-Storage-Upstream@marvell.com, linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, James Bottomley , "Martin K. Petersen" , Nilesh Javali , Saurav Kashyap Cc: LKML , Himanshu Madhani , huntazhang@tencent.com, jitxie@tencent.com References: <443fb75b-948b-430f-be33-170e6f592280@web.de> <20240428113404.12522-1-hyperlyzcs@gmail.com> Content-Language: en-GB In-Reply-To: <20240428113404.12522-1-hyperlyzcs@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:DHaY0Tigrkl34GXVyr7bpiaZ8EZhWqneFXFznlSn8aMn2Z+1yr6 hN/aKvbBLI7GRrxAz+ybXXkzeJdCQctKZ783I2AIz34mI7R14J6Fm8o5hW5hbpOqMfNaVet pkH4+1xpHF38NcOu+ovlH+S+/7BcupE7PoG5dkc8vdYBXqpU4zLqGx/eNTjuGPutv9vu7wS 1EqJwVPPanWOZoFeXRaKQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:uN1xlcZIsZ4=;Kp96PXXBw11iC5UJInr9kZBNFbD 8uGa8Ndl+XmLvn51uh7YA7tsGevYJHBOwl2no8hX441QxuvSd/LBeQT5OfDYb4rvDvS/obKAQ T16xCKTl3ectKG6QTp13MJEIN4Fa0654OiAfs4jB1qkb1+ofUHRLTorC1xzxDMBh6gcAjifn0 PNbg8LKEdXru+OeOKJREsKIVBiqnjqmIg9R/l98I7GYE64IjVdK2kItcJUeXmWzZ5fgoSLc2s Zlyx6p5FVxR4FTHsvGcMt/S6eKyD0CKmfB4L+dOfXuJe85FvnlH89QKTkCYlGzw94WJf1WpcQ 37lvhIn6AYuYt31IZAJSwLuEm7LjjIlXyXEohRkpXHpG/JTVjhuJU6AAY0XRbIpLQAuDqIRJv 0w9lQC7w9xUiZ8pkpQsWdTG2AFwPd8QRkbURyDKJgWpmz/0u71G7dv99yAO210t4DPKoEYhhV g8xroe8aejAb8oG0Y77XTj8loGSKTft1d6OEBv543PYJrvfmNCLdfwbuFULGZPVQkYLxMmMF4 PO2Hk+Q3nG1311JD8AXIP4OZDxdVSr/HLWi0WOXDGSAABEAYetgEzwucQ3dsAwELBMtZta3sm hli9nsYp8tLj5Spm1W7wVzrQJqUcnhjdhmWehrKvkJ78I6yMn4pAUuY+Jqc3Pr35lfuPHRSsL zR4c6rOn6Ax/SYr7k49pdo7ep/YGTT+XjjqZ4YVxKc9l0FZxZBS7wtZWney/5qmb3jYDEDG96 XVcPmBz0/eDK3IUBCx0Q+SlCyzVhM83sG0hc4prtUnr7okqkhO0THEd/489P976GP3nl2XSAq gMJQrl5HyzToEFnrxMb7QVjyuD+MrlkidO8QiMkQEEb5E= =E2=80=A6 > Fix this by cleaning up the redundant qla2x00_free_fcport() and > replacing error handling with a goto chain. =E2=80=A6 Can the following wording approach be a bit nicer? Thus clean duplicate qla2x00_free_fcport() calls up and use more common error handling code instead. > --- > drivers/scsi/qla2xxx/qla_iocb.c | 13 +++++-------- =E2=80=A6 Unfortunately, you overlooked to add a patch version description behind th= e marker line. See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Do= cumentation/process/submitting-patches.rst?h=3Dv6.9-rc5#n713 =E2=80=A6 > +++ b/drivers/scsi/qla2xxx/qla_iocb.c =E2=80=A6 > @@ -2787,6 +2783,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int el= s_opcode, > > wait_for_completion(&elsio->u.els_logo.comp); > > +free_sp: * I suggest to omit a blank line here. * How do you think about to use the label =E2=80=9Cput_ref=E2=80=9D? > /* ref: INIT */ > kref_put(&sp->cmd_kref, qla2x00_sp_release); > return rval; Regards, Markus