From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C337C433F5 for ; Mon, 4 Apr 2022 21:18:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379566AbiDDVTx (ORCPT ); Mon, 4 Apr 2022 17:19:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378979AbiDDQPU (ORCPT ); Mon, 4 Apr 2022 12:15:20 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 412192F007 for ; Mon, 4 Apr 2022 09:13:21 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EB05C210C2; Mon, 4 Apr 2022 16:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649088799; 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=raXRDw+a0zZfP7JGNDJxKyOaycQGAR8S7dB2MFmHS9k=; b=OOY88+y/nAwmznwvs9oOMsX27yTIbpGOJY317bbz4YuPasmJ74vhG4fQddGCXRsp6jIj00 +Tdhmr0l5R9Qz2pRBE0QwAZGO9suaBBUqnrODIercf0q5tS/DUAb+MKnHgI95MwCv5yN+F gYK7Ip20wWcgmn2j3/LQKt6MDMzuUo8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649088799; 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=raXRDw+a0zZfP7JGNDJxKyOaycQGAR8S7dB2MFmHS9k=; b=w3QHvwH1yiG1Yh0MB7Iwn0Rz472xITn+Sl28gYbxOuOIW52ReueexbjVLallkSSiQH52Bh 4pIyeSY7BEDsuWCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CFF7313216; Mon, 4 Apr 2022 16:13:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ws9yMR8ZS2JHcAAAMHmgww (envelope-from ); Mon, 04 Apr 2022 16:13:19 +0000 Date: Mon, 4 Apr 2022 18:13:18 +0200 From: David Disseldorp To: David Howells Cc: linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths Message-ID: <20220404181318.21c0740a@suse.de> In-Reply-To: <20220328145746.8146-1-ddiss@suse.de> References: <20220328145746.8146-1-ddiss@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hi David, Any feedback on this? It's a pretty obvious fix IMO. On Mon, 28 Mar 2022 16:57:46 +0200, David Disseldorp wrote: > From code inspection, the watch_queue_set_size() allocation error paths > return the ret value set via the prior pipe_resize_ring() call, which > will always be zero. > > Fixes: c73be61cede58 ("pipe: Add general notification queue support") > Signed-off-by: David Disseldorp > --- > kernel/watch_queue.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c > index 3990e4df3d7b0..a128dedec9db2 100644 > --- a/kernel/watch_queue.c > +++ b/kernel/watch_queue.c > @@ -248,6 +248,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) > if (ret < 0) > goto error; > > + ret = -ENOMEM; > pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL); > if (!pages) > goto error;