Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4081243rdb; Thu, 28 Dec 2023 09:24:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGf4NKM+0Xmb6Vl9tzn1y2B3gDwHlnuOSh0SJ3+pq2fFPs63zasyS+dP10uwYqvYCyAZus X-Received: by 2002:a81:524f:0:b0:5d7:cfe5:a476 with SMTP id g76-20020a81524f000000b005d7cfe5a476mr6491873ywb.74.1703784273494; Thu, 28 Dec 2023 09:24:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703784273; cv=none; d=google.com; s=arc-20160816; b=PFJu08p8jFuDvlnpDa2nCn1nrJlOr26KAnZc6FyTWm6M6ICsrZUgD4Iu6xjteQYcBn /Q+/o0/0iyZL8QtdaG1/jVqYKWeMuqB97gP6+0QmlENIBDZaTBePe/jKR9c4Fst6SG2R cIpI8YbB8uZTQuoMzdsfexv5ljOx/EedNcyTkd7wNW8/AZss4P6HnC0shCOEIc5jC0Wd pBbUXuM459eRKXG0uiiaVQXldantwxL+jXcDXuA3qRaj9d3AOeoDpCd74lAAbH+P0g4r EPyx4Cy8EvwAK5XFOoSQ2JvXLdoqSqCgLfqxkVK0e5NXwRQmmJe/dBXHXr4LHWwr/Wp2 kRYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=EZgux4gbKC52OUGiGcV95kl/nL35BJLkpra4zquPgqc=; fh=UF3DLcBgV+qVMrcMwsk5goUAvcQPQpxbgR5Yw1H6KJk=; b=b4TW774lYhaM02AAWV4dJjXNuWiPlkBpNnd2eaWurv49L8NHeKtXhNldRicPaYutTA XVNfaZpxZAMcz9j2Y/jFUf623BiFCy2Sjzo4cBfVb4aZrUiboda43jBjwbEm5EM0jCn8 IUWwDg19ryq05abMXr7ofw0oq2MIgjiZc0ZPTr1MRGNdk6Nu8a+wtodi0Nkjij7QbMni 6cL+0M+BsWqsH0/VBeu3vAZY7oIf/PRnoEyR1Z2fhsPLmqM8PV6xBkMfBZfyKPKEbm5u sTWX1FX07vyvTxYydPA3LZQrq/cW2E45jGx3dw6CeHgtyw+ks1ZOAZ2x41vyJrJT5TiF Jbng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=woj0ouMH; spf=pass (google.com: domain of linux-kernel+bounces-12811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12811-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e4-20020a05620a014400b0078156a6a6a5si5767806qkn.220.2023.12.28.09.24.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 09:24:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=woj0ouMH; spf=pass (google.com: domain of linux-kernel+bounces-12811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12811-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 430A91C20C08 for ; Thu, 28 Dec 2023 17:24:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7FB101C2; Thu, 28 Dec 2023 17:24:20 +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="woj0ouMH" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.17.11]) (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 83E19F9C1; Thu, 28 Dec 2023 17:24:17 +0000 (UTC) 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/simple; d=web.de; s=s29768273; t=1703784246; x=1704389046; i=markus.elfring@web.de; bh=4XlxHJDHSmu9DTtlturBDNHee1wz7AQbL0bmz7RZbq0=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=woj0ouMHLYY7ibHMUL64iTcnX7olMYiuDthJKiG0aiwdNFxCjFdWrJdmvRen4gYg SHqbn57hkBus4CTgbjtjLaJ9uYCutP+KzqWHQCBerfHQm1s+osrG6x7P0asxx4yRB IUK1eK5Hfcx7zjJ9x2qjlLd/swBA3fJjo6D0ALXdjFONd/x4z8iDMVkKPXiPJZjjZ Y+up3bOXLWNUEq8DFeH1jiF0MuUI2eeN8pBjudwmbr8XU0tMxwojjUHkHICCjQwV8 BpMv3idkQvYY7YGDDFtgXsucVClXHIdwsVqrDJl7WP0PoU8Q6KaIWxBkQHQWlDRon xFN9fqGKIL8B4gPBzQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M43GU-1rIu7439Si-000Ft3; Thu, 28 Dec 2023 18:24:06 +0100 Message-ID: Date: Thu, 28 Dec 2023 18:24:05 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/4] scsi: lpfc: Return directly after a failed kzalloc() in lpfc_sli_read_link_ste() Content-Language: en-GB From: Markus Elfring To: linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, Dick Kennedy , James Smart , "James E. J. Bottomley" , "Martin K. Petersen" Cc: LKML References: <48a127e8-ca4f-4fc4-81b7-226080fba720@web.de> In-Reply-To: <48a127e8-ca4f-4fc4-81b7-226080fba720@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:uIeGhHJ9SX2ZMZpWX85Jqs1cor36TOwqWrCC1YmAOQ9bZYmxpo9 JaxrzdcpwFOx6pDeiYXUJbUUa6Qq3lLprlWCa+GnuKzgMrGr2kkeVmkV3qwZZD0N1dGu1cs fMnEjuqBqYXQzIOxXKkZqD5NjYFmufdbCGiG651kYOGxzrmxo3S7VkejiLxUHvYBvGH0s8p a25p4oBUcrSr2I+Q+VdVQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:DmmwTBIHlcM=;+v8eqOTTMeJo2NnLUZzwP3IWP/U ebNYeII958j7OGFbNxPZaxR4ksv6TRTf4qOwfmKCpPtsT5hhlIgK9jAHu9NRM6rmXKlEGz1gJ ClIAwTWUbrYJaagSyo893Nh6Ce2/eJzlJ2/7LkFxdIv+Ks4Orlt0yWA7DD84TRTYFfysn83nb vDIgDTivGvYhtcjaH9p2BCBNpuSShzjiPQMpSnEV62wCSagWzlOBvfzImxcDXDoC2mDqZDBOl sEkxmmOGuncbGXraij6wG+vJi9L7D9D/Uppe2DikDMdP7r2bnES/JUFQhdtbmj5BCAB7Rl2ww +jiKDXSwDQWF4hY/iYm9oAi8koYDSJHhXDfDbHufklpFfTtvnnJO9H6Q0q12J0R0h1lytT6DY BH0Ng72TXIdzny7QGJgzpC/QJGK0rgy1tXJsLi/gSAN0Fyv3WL4DKt5OD3LC5BywNvA6drnvb rtDo0qv21wQRbKePmjv2nMutGU34+kf8wkLb49wDnEYKY3SjxfjIjAPt6QsL9GZRIMKqwhdPR HGeK+BU2DZqpT7qD5IYGQDEna1BELAURaP1vGGD8CqpqBZIky5786mh97wbTyhl5kXqae0Z0C L9evAfZAvfAyMrqJyjCYOx4+wTIDmDgJkoeEA5iVi/GREwiOE30blI32RfuvkBGMFtRZ419LU 8OzUEcrWIunzV2iuyeA9ViOxw0jzPV1+anSGOaee0fioWLA3FL/4wSV3gBdq/iLfOCGjoL7ek TImXNxf6QCqd4m3kzVcPJsFWyOgtwImVVl60YQbweA6UkBsfL/yqkxzSd8Q7zf55HHm8qrJpP vCQmqbqSmFVvR1Ij0FVFsjOtT1eOPCe6/4Jb6VcchH/Tk5XPUKiR4+pxm13gknqnH8Tru8bv5 xIGK5RMXE+CsAVhdT1nBbceIt3sJh1JVGzViLWAxPYshRwrBpGqywbeHJ4l19IRAe45qPJbGi wIlz9A== From: Markus Elfring Date: Thu, 28 Dec 2023 17:13:50 +0100 The kfree() function was called in one case by the lpfc_sli_read_link_ste() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Thus return directly after a call of the function =E2=80=9Ckzalloc=E2=80= =9D failed at the beginning. Signed-off-by: Markus Elfring =2D-- drivers/scsi/lpfc/lpfc_sli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 706985358c6a..93339425ce3c 100644 =2D-- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -20701,7 +20701,7 @@ lpfc_sli_read_link_ste(struct lpfc_hba *phba) /* Get adapter Region 23 data */ rgn23_data =3D kzalloc(DMP_RGN23_SIZE, GFP_KERNEL); if (!rgn23_data) - goto out; + return; if (phba->sli_rev < LPFC_SLI_REV4) data_size =3D lpfc_sli_get_config_region23(phba, rgn23_data); =2D- 2.43.0