Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1556218rdb; Mon, 8 Jan 2024 03:10:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IF046DgIfGD7Tkx8Al2VsCdD4Utm4Siq5rig5zaPYu8QBOFEmyeBNF0EMwzLEsZInCs4RFB X-Received: by 2002:a50:fb07:0:b0:557:41c4:cbdf with SMTP id d7-20020a50fb07000000b0055741c4cbdfmr2281961edq.49.1704712215888; Mon, 08 Jan 2024 03:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704712215; cv=none; d=google.com; s=arc-20160816; b=GsV35TH+kyOD63x7ycHip6cjdAcefMlOieUJ5QkINtG+Ftpbrk2L0ZkenR1yKHwiWq nfajr7GxNJ0nlVnc3i6+XfOr8U91VDjFXPjAd9ylx4nxepapWGvBw36n6S/NtWpDS7Hd uJ9YnWQ/0o+GSz1ka7rFjlKUEu+lMuak8Yjcw5Mhfu0G8bV6dd2Zrt5uU04JIWqga3o7 MUBIym2q+9LEhc2VprmDDfHLO9W/qO/OpZtn0DSkArn4SBDPZppz2F93wWoopSzUsztw 6npJetsyXVkzutKxgHzVSCN16lO33rvzSgb33TaW2J0pzqvsArrSNZxMhSTMm54yOQg0 zhOg== ARC-Message-Signature: i=1; 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; bh=XF5g63PxgUfcpdhZm7KbjtFAwZYlqAklUlv7vcrbkUU=; fh=TVRje3uBVaH5JjykIl/ThQDuz97ciFNQyR1j7GV2vhI=; b=EG5rDsQGFcrHIZy43kPg4erN9M3ewnOMBGKpnWznpR3qsNxpge5/Jzm1TVZePCdWSc mgLEhBHnv0tTkyyGAGvN4ijO+Gu+qsymd1aC1tvZMcQht295JUnIENiu5TOMwgJD3T/i al3RUvzIP5Jzup7v804w6mbwIAHIAQn/ClyyWs5zcIRleO2FL0ulHEKgOXhapyfSVypK ptTEm8V0Btjg84LBRh/gfhlbFrxKNpvK/v3I4DyXL0vi/E63hYoYHpn0I3SN+Bnd6BfB Fp2pVwZX3jldiY14tIqZGkbi/KJpqfcZDIkstajjzMMW+YXGkJ6ZWa/DhPNLRFqTWC/A gIRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=D0vpJnOO; dkim=pass header.i=@codewreck.org header.s=2 header.b=D0vpJnOO; spf=pass (google.com: domain of linux-kernel+bounces-19388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f12-20020a056402354c00b005573c02f5eesi2824627edd.472.2024.01.08.03.10.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 03:10:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=D0vpJnOO; dkim=pass header.i=@codewreck.org header.s=2 header.b=D0vpJnOO; spf=pass (google.com: domain of linux-kernel+bounces-19388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 957931F226BC for ; Mon, 8 Jan 2024 11:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EA7C14282; Mon, 8 Jan 2024 11:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="D0vpJnOO"; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="D0vpJnOO" X-Original-To: linux-kernel@vger.kernel.org Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) (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 EC22614A8D; Mon, 8 Jan 2024 11:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codewreck.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codewreck.org Received: by nautica.notk.org (Postfix, from userid 108) id A0040C01E; Mon, 8 Jan 2024 12:09:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704712190; bh=XF5g63PxgUfcpdhZm7KbjtFAwZYlqAklUlv7vcrbkUU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D0vpJnOOoJWIkhkTlf819dMpz1fgMNkafsPkwn9gfyDhdHkc57oyyKfkkCqlQMQw8 pG28nVTSef3HGgED9V8kjXsBWnGsbHdFGkYZLtFjy/lEJ5mX2rDmtIESwJ8yMDF1cg QarwsgrM4OD71QJparO/1ku3EFgwtkH/u6NO/FVxKzMsFpNxcXKRw8Z5J4aaJZounp O4e/SoBKL1HlY0oBy5U4UoYkGRfbp0isksL7RyRBHO0quLRy5RZ6Zwvev4ROVzyLpH n60eL/uznVyajz4fbgk2GsBWva/s2uRYD4QMcMkaEEbuobli2g4ola31Tu8BgBFkLd 557z2UT8rdDlA== X-Spam-Level: Received: from gaia (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 9D91DC009; Mon, 8 Jan 2024 12:09:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704712190; bh=XF5g63PxgUfcpdhZm7KbjtFAwZYlqAklUlv7vcrbkUU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D0vpJnOOoJWIkhkTlf819dMpz1fgMNkafsPkwn9gfyDhdHkc57oyyKfkkCqlQMQw8 pG28nVTSef3HGgED9V8kjXsBWnGsbHdFGkYZLtFjy/lEJ5mX2rDmtIESwJ8yMDF1cg QarwsgrM4OD71QJparO/1ku3EFgwtkH/u6NO/FVxKzMsFpNxcXKRw8Z5J4aaJZounp O4e/SoBKL1HlY0oBy5U4UoYkGRfbp0isksL7RyRBHO0quLRy5RZ6Zwvev4ROVzyLpH n60eL/uznVyajz4fbgk2GsBWva/s2uRYD4QMcMkaEEbuobli2g4ola31Tu8BgBFkLd 557z2UT8rdDlA== Received: from localhost (gaia [local]) by gaia (OpenSMTPD) with ESMTPA id ccc77bd4; Mon, 8 Jan 2024 11:09:45 +0000 (UTC) Date: Mon, 8 Jan 2024 20:09:30 +0900 From: Dominique Martinet To: Markus Elfring Cc: v9fs@lists.linux.dev, kernel-janitors@vger.kernel.org, Christian =?utf-8?Q?Sch=C3=B6nebeck?= , Eric Van Hensbergen , Latchesar Ionkov , LKML Subject: Re: [PATCH] fs/9p: Improve exception handling in v9fs_session_init() Message-ID: References: <7203d3fc-f1e4-4fb1-8dd3-068b0ec6c752@web.de> 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=utf-8 Content-Disposition: inline In-Reply-To: <7203d3fc-f1e4-4fb1-8dd3-068b0ec6c752@web.de> Markus Elfring wrote on Thu, Dec 28, 2023 at 09:01:49PM +0100: > The kfree() function was called in up to two cases by > the v9fs_session_init() function during error handling > even if the passed variable contained a null pointer. I don't see the problem in calling kfree on null things (especially on error path). The only bad pattern I see here is that it relies on implicit knowledge that aname is null before the call (which is true because v9fs_session_init is only called immediately after kzalloc); is that what your coccinelle script was checking for? Anyway, as far as I'm concerned this is more churn than it's worth, but I'll defer to Eric if he wants to take it. Thanks, -- Dominique