Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4677522rdb; Fri, 29 Dec 2023 09:29:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRfOrzyEwObmZaVrA92Vn05qfM8rHYZD5yRVYZBf+7PdFvPMZv9RW0TUEqqcNZhpRPPp0l X-Received: by 2002:a05:6808:3c97:b0:3bb:d150:ec5a with SMTP id gs23-20020a0568083c9700b003bbd150ec5amr4076229oib.102.1703870960495; Fri, 29 Dec 2023 09:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703870960; cv=none; d=google.com; s=arc-20160816; b=Ij/QD/pyJtB26LEfTED7PK0BxmvFiSxj0LR6Qg4l7EdXpZnuXKJaQPeABM+SwtF/r6 wgj1O28G0hS4MARPbsc1GgZnuqz+UC6ZKSS/vTXeaQFU1laZhe0xhknzc7FT3lOnAStW GIup3rbSmwTxV0aFppt+G12kB5sWvir3IaeO2YJTwLLRiRN1uWgLHA0k/r4TfF0I/lJW BQYI7oDLEp1giIDluGM5+CGu9sgZSe0E0btcvJ0Y+hlFnZeKG6THLrR2yCtqZa1Q/yoe vHaqvEOrlfrM0E2iLPtJFv04ls786sN7PBKwoH4Vp0qV4Cy5+SBa8H1OV4a9Nk51NNos t46A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=xrWs+MrhNlw7+uIPLMBuNj81/lHdj7mSahUJV2XHzL8=; fh=3+5vOfFmUNUc/MWn9PyR9mcZztpdk7RsabrUzyFP57c=; b=suKJkVyj710rTXaxF7mmBxJvICrYkeylQL8o6PumnyFEskouaBRIG2CzWe02o3+XL3 ztE6nwG81HyElHKTZL9j/wIdmZ5Rk1y4+YfiZV3WRGo3yZFXrapz/GLigY/gcTOasCwK 4FjMu60iJ6GI/p506kJDqPYlZ2pLa2dOVoFR6uaR00LKvHW0xvmv8C9M9rPRoC8PrHqD SPVmINNFJOlKp8JPOoxJ4JHyr/E3d33mR0GRmPGby+TeAa14dty+Ba+02xpm61uOq7wy rJGdCaEXOGpgtKkpmOTAnLBh0QJCtRHQfVVovHv00aGBritW25cplhQNWFz9v9uT+FSN q/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=UUpPtQo7; spf=pass (google.com: domain of linux-kernel+bounces-13184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o28-20020a05620a0d5c00b007816bea89ebsi4771218qkl.769.2023.12.29.09.29.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 09:29:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=UUpPtQo7; spf=pass (google.com: domain of linux-kernel+bounces-13184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr 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 4304C1C2197A for ; Fri, 29 Dec 2023 17:29:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEE4812B8E; Fri, 29 Dec 2023 17:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inria.fr header.i=@inria.fr header.b="UUpPtQo7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (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 4B0FB12E43; Fri, 29 Dec 2023 17:29:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=xrWs+MrhNlw7+uIPLMBuNj81/lHdj7mSahUJV2XHzL8=; b=UUpPtQo7IVwVIwqhaHavBEA469c1pug59iaaGEeW5MNPDtoJE11yakVZ GXl/18PM83xQPndKGAu2IAfX6r2JAYrkchOl9o64Tv0F3Q4q7W9kxSSUA r4KW90AtpHndCQlpyEWUCvYjQEOgoXCDkegp494gIOJSAhEhJ5c2BkXRI A=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.04,315,1695679200"; d="scan'208";a="144322364" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 18:29:03 +0100 Date: Fri, 29 Dec 2023 18:29:02 +0100 (CET) From: Julia Lawall To: James Bottomley cc: Markus Elfring , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, "Martin K. Petersen" , LKML Subject: Re: [PATCH] scsi: ses: Move a label in ses_enclosure_data_process() In-Reply-To: <9d24844f30604f969ac10da456801f594ce72f2d.camel@linux.ibm.com> Message-ID: <50978c86-cf4a-991d-54ab-50d8d977f946@inria.fr> References: <4616e325-e313-4078-9788-dd1e6e51b9e0@web.de> <9d24844f30604f969ac10da456801f594ce72f2d.camel@linux.ibm.com> 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 On Fri, 29 Dec 2023, James Bottomley wrote: > On Thu, 2023-12-28 at 15:48 +0100, Markus Elfring wrote: > > From: Markus Elfring > > Date: Thu, 28 Dec 2023 15:38:09 +0100 > > > > The kfree() function was called in up to three cases by > > the ses_enclosure_data_process() function during error handling > > even if the passed variable contained a null pointer. > > This issue was detected by using the Coccinelle software. > > Why is this an issue? The whole point of having kfree(NULL) be a nop > is so we don't have to special case the free path. The reason we do > that is because multiple special case paths through code leads to more > complex control flows and more potential bugs. If coccinelle suddenly > thinks this is a problem, it's coccinelle that needs fixing. Coccinelle doesn't think anything. Markus for some reason thinks it's a problem and uses Coccinelle to find occurrences of it. julia