From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 244BA21D3C0; Tue, 26 Aug 2025 11:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756208937; cv=none; b=QkfXgPypHo2ulOVy+e+04/4OTITMrEoK2qFhkL9SuZBcs7lPCc1yJTicl6y+Di08aZ4cDW9PrjBFhms3B6EBqzdmn2hL/VPIQeKdhtMRXMgrtn6e7FJEVzXlZvxf3MecLaur3hKcY37yrLjaXA893Tr+dD1rFfqBrMTO7EYlIag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756208937; c=relaxed/simple; bh=a0rEK2kAzlsObCA1jgM1oawyJYGwTD0MvUqYqfJUR8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Doo/3qTFW+sHZJH3SU051KpHRzwk6q31XEqi2BtUHC0lvTqoZohiGob6ulWP0hxx8hLys4DlWJi5t5DQf5bhDKbvJqwSAwSHnhCtYLqCBnUTQ91aSUCiz0CYPbXXv8BS5Z6Brnk64kSVovoMUtAZew4/IDLs7U/t61IH4hvrw5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ta59N+eL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ta59N+eL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABB9BC4CEF4; Tue, 26 Aug 2025 11:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756208937; bh=a0rEK2kAzlsObCA1jgM1oawyJYGwTD0MvUqYqfJUR8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ta59N+eLiNkrtJK8lG4eG7Am5osduhvjgUCZG88xc8OwRR222JHkfeZjVQRz6zznc zQ/ha9dtozpIAP3K7G6lpEdvZlXS3hKjD6uKZGqW0h1HaerXuwQ8HSqG47NuKA5d+L Lw6Ru9dnnpnpuu8b5pvtubnMpM+rOe0FjlF27UWs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Chris Leech , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.12 275/322] scsi: qla4xxx: Prevent a potential error pointer dereference Date: Tue, 26 Aug 2025 13:11:30 +0200 Message-ID: <20250826110922.714690279@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110915.169062587@linuxfoundation.org> References: <20250826110915.169062587@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 9dcf111dd3e7ed5fce82bb108e3a3fc001c07225 ] The qla4xxx_get_ep_fwdb() function is supposed to return NULL on error, but qla4xxx_ep_connect() returns error pointers. Propagating the error pointers will lead to an Oops in the caller, so change the error pointers to NULL. Fixes: 13483730a13b ("[SCSI] qla4xxx: fix flash/ddb support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/aJwnVKS9tHsw1tEu@stanley.mountain Reviewed-by: Chris Leech Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla4xxx/ql4_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 97e9ca5a2a02..59ff6bb11d84 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -6606,6 +6606,8 @@ static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct scsi_qla_host *ha, ep = qla4xxx_ep_connect(ha->host, (struct sockaddr *)dst_addr, 0); vfree(dst_addr); + if (IS_ERR(ep)) + return NULL; return ep; } -- 2.50.1