Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp739277rdb; Thu, 8 Feb 2024 22:24:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUL6dELXxEl1eMN0ztimmLj9ThemZeR5dHj67AZBZUIJ8TyxPgi3N4Isu/jLMssTMeLFiB8l79vf0yVZ8fM4vpRfkcibgfs/kF93RSEJA== X-Google-Smtp-Source: AGHT+IHpbla28Kvf6WKJZhprrr5Pb7CcNeeB9N6rcvkV/p8dzjIjYRXDaBY9vJpPwCvVvCyCbAoI X-Received: by 2002:ae9:f30b:0:b0:783:68a2:db8b with SMTP id p11-20020ae9f30b000000b0078368a2db8bmr709522qkg.65.1707459874630; Thu, 08 Feb 2024 22:24:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707459874; cv=pass; d=google.com; s=arc-20160816; b=YNdQkSRp2FDGRnMCA6KyTby0Moln+mf4g4V2+bsxWL4LBMD1/utJNnGvXUGs+NwV6Z 6VCds2daFZy8A8zXPb6RSoQD0aFxw8HIYiSj+QHIfm6OzY9OHQFyhG+8WVOuMDj1J0S6 UhqybGWRABa1iyuVNdsHSnjr+DyEwZdBpFr+vQ2MAd2ODgzOaZQRYGJBs6uHRuerlU9c BnWaiMgIDq8ju7/dJAriFQdwjsdAfsDGzXYNHc48OyY1VtrlAyJm64gSoDXLzRmXzZv9 4yX41/WFkz4ZGHScVacOYLfbkcSDBRTvrUwqsCWdLmKip+r74jwsFfXssSyM4TK/pKy9 +IHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=RLtqCnLoHDcowrIyQ34cuvnOLg2AS9p8XbafIJGUDZs=; fh=kpGAddTeIerBaJZtmoKESQgBs+tAEg3vyQ9Z2l3lqGs=; b=dbKDmliPdjneYmdS06p9fCYbljRArZsEngUCdzjykqI9RLpWQ8igsxc2RSVzHVUv/L Mabr7N+2hj1FeiChiPOYrRUSP4BK0ZNFosFe1FOQUXAf5avLWJlXlQtvd3iSlCv5p3Z/ BLHNubWTagcM3lFky42k0wNAW1rqRXS5mZBu7/mu9be5xsEHQCw8Ck19tl6q9quKtgcb dlKIalTUzqUC2wogBAcZ7I8B0H9zFJmBmUUGdRRDFqOkLeW/w+06HRlt4anx1Kz6J9bD di7xp1tcnjkQ6orS4Hwf9RwpMkO61cTmGJazTUxKYYwgxaUJhcWclzL756t9Di32v81e MBag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lPwB5hIf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=PADFRAJP; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lPwB5hIf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-59040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59040-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=2; AJvYcCUP7QshUmkdWUlgpu0/mEMFi24ofc5k+fyAGBv4QqXBZnPrceJHLpwJOET/Tcy5IJgbrW3wa8De4A6m4rllvd4USgkyNXUVf/90ZkBUuA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dt49-20020a05620a47b100b00783b5c83466si1375019qkb.336.2024.02.08.22.24.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 22:24:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59040-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=@suse.de header.s=susede2_rsa header.b=lPwB5hIf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=PADFRAJP; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lPwB5hIf; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-59040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59040-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.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 419991C21EC9 for ; Fri, 9 Feb 2024 06:24:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0836357318; Fri, 9 Feb 2024 06:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lPwB5hIf"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PADFRAJP"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lPwB5hIf"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PADFRAJP" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D36EF57310; Fri, 9 Feb 2024 06:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707459860; cv=none; b=QfyJopc5zJbgmyG9WzHdA8ndIswud+D7Jf9tG5f3quH3gvXTdccv8HbccQQajctZTxk+0jNPv2Eed+wmY7gsEgE/V5Gpi37fMbRiQ+fjGXMwBLb6m1GbmLuiUSzd467xJ7u+oOlo9GbKnw3hsoxnX5qu6uIWf88KI5oZrwKbMwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707459860; c=relaxed/simple; bh=89RlaZiW2zFWOUG3IqWYiZXQPTee7Dmk8dUcq3QXIrI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r2UxGf+QMWhCuq4WGLVHE5yco5mVfQXJKEwRGGIBZe6dUYp82pdCyR9QHktPkXQOdQr1Ih2sPPmSfayBRfu2gvhBq7mkxskvZzb+ml1hqp4hN/GHfv+WsFSiu1/rWydHo2EeJpY4LLD/8jKiT4vNW0+GhVkCL+yEKM1YIf4JNWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=lPwB5hIf; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=PADFRAJP; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=lPwB5hIf; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=PADFRAJP; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A9E611F7DE; Fri, 9 Feb 2024 06:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707459855; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLtqCnLoHDcowrIyQ34cuvnOLg2AS9p8XbafIJGUDZs=; b=lPwB5hIf6hZWKniOlXq/i4koRAVGs8RtjFJqe47F5TQRfHJ5cEuZdIVdvCLR3DcEvhxJg6 7bl44qQlWxqIC1/n6xY+q+I66ppgehFHifnGG7QGrYuY1uIEIAo8q4cEx0KZluyqhk3BPd 0n5lhhOtrJkUGde10/gSVzJNkMHEq4w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707459855; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLtqCnLoHDcowrIyQ34cuvnOLg2AS9p8XbafIJGUDZs=; b=PADFRAJP8mnYZ5ZwUwvsrGbb7iJ0bnu2NSLzjomU9kHvvjFsHpkaex8RkN7k+Njhe2NpGD e4UDERtDwR63j2AA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707459855; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLtqCnLoHDcowrIyQ34cuvnOLg2AS9p8XbafIJGUDZs=; b=lPwB5hIf6hZWKniOlXq/i4koRAVGs8RtjFJqe47F5TQRfHJ5cEuZdIVdvCLR3DcEvhxJg6 7bl44qQlWxqIC1/n6xY+q+I66ppgehFHifnGG7QGrYuY1uIEIAo8q4cEx0KZluyqhk3BPd 0n5lhhOtrJkUGde10/gSVzJNkMHEq4w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707459855; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLtqCnLoHDcowrIyQ34cuvnOLg2AS9p8XbafIJGUDZs=; b=PADFRAJP8mnYZ5ZwUwvsrGbb7iJ0bnu2NSLzjomU9kHvvjFsHpkaex8RkN7k+Njhe2NpGD e4UDERtDwR63j2AA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6B14A1326D; Fri, 9 Feb 2024 06:24:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +kvPGQ/FxWVDXAAAD6G6ig (envelope-from ); Fri, 09 Feb 2024 06:24:15 +0000 Date: Fri, 9 Feb 2024 07:24:13 +0100 From: Daniel Wagner To: Fedor Pchelkin Cc: James Smart , "Martin K. Petersen" , Ram Vegesna , "James E.J. Bottomley" , Hannes Reinecke , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org, stable@vger.kernel.org Subject: Re: [PATCH] scsi: elx: efct: adjust error handling inside efct_hw_setup_io Message-ID: <2ik7x74hq6exam5ab4v2moauy4lfvqe3r626bxxettseat2nmv@q4gykxnezkff> References: <20240208093657.19617-1-pchelkin@ispras.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240208093657.19617-1-pchelkin@ispras.ru> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lPwB5hIf; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=PADFRAJP X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-1.01 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[39.25%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[12]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -1.01 X-Rspamd-Queue-Id: A9E611F7DE X-Spam-Flag: NO On Thu, Feb 08, 2024 at 12:36:57PM +0300, Fedor Pchelkin wrote: > IO and WQE buffers are allocated once per HW and can be reused later. If > WQE buffers allocation fails then the whole allocation is marked as failed > but already created IO array internal objects are not freed. hw->io is > freed but not nullified in that specific case - it may become a problem > later as efct_hw_setup_io() is supposed to be reusable for the same HW. > > While at it, use kcalloc instead of kmalloc_array/memset-zero combination > and get rid of some needless NULL assignments: nullifying hw->io[i] > elements just before freeing hw->io is not really useful. > > Found by Linux Verification Center (linuxtesting.org). > > Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines") > Cc: stable@vger.kernel.org > Signed-off-by: Fedor Pchelkin The patch looks okay. Though I think this funktion leaks all over the place memory as soon we take the error path. Could you also prepare a fix for these path while you are at it? Thanks! Daniel