From mboxrd@z Thu Jan 1 00:00:00 1970 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 365C94C3A5; Wed, 10 Jan 2024 16:55:58 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="McKduXR5"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SGEq7OYd"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="McKduXR5"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SGEq7OYd" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 D29FB1FD7C; Wed, 10 Jan 2024 16:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704905741; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZ2nz3JBuGT1gBLqsXE8VgXk0KCKqzgbkm3ks4acA2c=; b=McKduXR5XJlHNDuXtSKc4Zkjj1j1siVD+uikzNtdzT0k/pDuikD34No2BtI0/Vp4VNTp+Q 2Cnm4tTGFSCyJQEVbqJ+XY6I0KsuBIsjc5MU3A+vF+oQzoI+Zs3vVqC+ZN0/83800md8aH ZPdq9TukGnqxLlEhv4bhh0uFqybglgI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704905741; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZ2nz3JBuGT1gBLqsXE8VgXk0KCKqzgbkm3ks4acA2c=; b=SGEq7OYdjLs8b4CeO/imUlggK4/nQfOPpzfpoJBjAK3Tnnoj8V+PAr8v7DW/umSQ6+7nhw gYjczUMjdgDhgDBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1704905741; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZ2nz3JBuGT1gBLqsXE8VgXk0KCKqzgbkm3ks4acA2c=; b=McKduXR5XJlHNDuXtSKc4Zkjj1j1siVD+uikzNtdzT0k/pDuikD34No2BtI0/Vp4VNTp+Q 2Cnm4tTGFSCyJQEVbqJ+XY6I0KsuBIsjc5MU3A+vF+oQzoI+Zs3vVqC+ZN0/83800md8aH ZPdq9TukGnqxLlEhv4bhh0uFqybglgI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1704905741; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZ2nz3JBuGT1gBLqsXE8VgXk0KCKqzgbkm3ks4acA2c=; b=SGEq7OYdjLs8b4CeO/imUlggK4/nQfOPpzfpoJBjAK3Tnnoj8V+PAr8v7DW/umSQ6+7nhw gYjczUMjdgDhgDBg== 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 158EC13CB3; Wed, 10 Jan 2024 16:54:24 +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 +R2jLsDLnmWJDAAAD6G6ig (envelope-from ); Wed, 10 Jan 2024 16:54:24 +0000 From: Gabriel Krisman Bertazi To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, io-uring@vger.kernel.org, Hao Xu , Jens Axboe , Pavel Begunkov , cocci@inria.fr, LKML Subject: Re: [cocci] [PATCH] io_uring: Fix exception handling in io_ring_ctx_alloc() In-Reply-To: (Markus Elfring's message of "Wed, 29 Mar 2023 17:46:03 +0200") References: <6cbcf640-55e5-2f11-4a09-716fe681c0d2@web.de> Date: Wed, 10 Jan 2024 13:55:53 -0300 Message-ID: <878r4xnn52.fsf@mailhost.krisman.be> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: 0.20 X-Spamd-Result: default: False [0.20 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[8]; FREEMAIL_TO(0.00)[web.de]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[vger.kernel.org,tencent.com,kernel.dk,gmail.com,inria.fr]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Flag: NO Markus Elfring writes: > Date: Wed, 29 Mar 2023 17:35:16 +0200 > > The label =E2=80=9Cerr=E2=80=9D was used to jump to a kfree() call despit= e of > the detail in the implementation of the function =E2=80=9Cio_ring_ctx_all= oc=E2=80=9D > that it was determined already that a corresponding variable contained > a null pointer because of a failed memory allocation. > > 1. Thus use more appropriate labels instead. > > 2. Reorder jump targets at the end. FWIW, I don't think it makes sense to have the extra labels or re-sort without a good reason. kfree works fine with the NULL pointers, so there is no bug to be fixed and moving code around for no reason just makes life painful for backporters. Also, the patch no longer applies. > 3. Omit the statement =E2=80=9Ckfree(ctx->io_bl);=E2=80=9D. >From a quick look, this might still make sense. can you confirm and make that change into a separate patch? --=20 Gabriel Krisman Bertazi