Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3488236rdb; Wed, 27 Dec 2023 08:57:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbk0ac2X443NANUw/GcHZXpZBrA24x5Q5Ebw32gFdT4I7Urse/iu5V+3dxBaEh8HAP8yBU X-Received: by 2002:a05:600c:2941:b0:40d:60ce:1694 with SMTP id n1-20020a05600c294100b0040d60ce1694mr256471wmd.222.1703696227986; Wed, 27 Dec 2023 08:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703696227; cv=none; d=google.com; s=arc-20160816; b=SvkBW5IE2k4xRy7W/1CxpP0GGVyBx+Dg7eVSsOOinbeYmODv+/7o7eYEvij+eZ0b4I iPMf6MONSmESL2IzH5FVXQyd84tEWoU8uT6kuZhqxi+Zvs/+SwK7+NWnlVDgRqqUlIZQ I5TS76pjaim48A43GFbzBBzfEASwKGuU3kb26sJr8RP3s9fBR5bSJcKp4AoVqiKoNwlr 649IbLjib0ZOdWypWwd/cfgWsyKXlGJ40pjN0wWd8+jah/R2h8gkNV/KWfHDeQoZpnVe YKmyAT4j4Nr8jxMymQS8fbHf2aTKgNoiTjJxRZwXVXSSf0pfwkI9e/Qk8IFRArNhedF3 R3dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6/LHjpHU5KC4lUakP3sy6OtQjIW7UB3Vj4+/+9pbLJI=; fh=0pdVaMJuVba0SgKVl1cNeel28p5awosyfqMGVstiCPQ=; b=ES2jUTDcP0bjUC42TcHJ3ElNvtcztnMc0HPQN3p7v0ZcDSa63VjNAGW+YIYHcfWu/J t6i1FIhM2RwP8kKWYtPN4lE7dA4zkpjC76EynoNhHCaAJonu09pV1J5QlmcFuW8HP9BL 4jmNx19Tef7g/uwYS6cH8QVz+FfauvVmcMokWPJCJIXYOBFtDyOzAy7QjyCkftZ6yaqL 0D6igIe7NoTHreC53JYQ1kt8hOrWA04I+xkm1sSTy0iiYoMimCMpfNJurxMUubiHvkwz daXPphX91i3d7p8CZTJVyNgupU1rxMFqraKB85MvTGl5DKMgvLB+Kf3vmcBuYUiRMZsm vgpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FHNOIsH0; spf=pass (google.com: domain of linux-kernel+bounces-12153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ka10-20020a170907920a00b00a26d802aba2si3923059ejb.37.2023.12.27.08.57.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 08:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FHNOIsH0; spf=pass (google.com: domain of linux-kernel+bounces-12153-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 704E31F221C0 for ; Wed, 27 Dec 2023 16:57:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC19D4643E; Wed, 27 Dec 2023 16:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FHNOIsH0" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 0534F45BFE; Wed, 27 Dec 2023 16:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703696214; x=1735232214; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=2yJFTx4ZE8jECzs1+U6wqnReWCpAiewcEcFY9qdNd5A=; b=FHNOIsH0qG4MTaBS5PX6RzIX0sOOsqc8vrcGDqmKKOAR3LAS6FgbDTmc UPQlCkEmSkJdaqhJmmjClXBd8L71q8wGU2eOWDhiRmpzmqXaBh8ftCue9 uCqLPtZtClP1UHocXIqf01dTnd/7SBrSn+mL1wOAnqaRgcUvJhaftK1Vy GaQuz8TF885IPrBp8VXUzGm0B7IZCi6Yb6mft/p2B2L48I8Dicgzzv3/h zxJrDc1D1e6NEX+eZtRD4E8iaIT7aZ9NshygwmFvR23Tc9IPWlLrKgz8k zv/JhAtNOdxUXA+0XA8N7JnloRdtYddMz2HhLRDmUB4nKqzBRmc1iE0BH Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="15131643" X-IronPort-AV: E=Sophos;i="6.04,309,1695711600"; d="scan'208";a="15131643" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 08:56:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="812572900" X-IronPort-AV: E=Sophos;i="6.04,309,1695711600"; d="scan'208";a="812572900" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 08:56:49 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rIXD3-00000009T7I-33IT; Wed, 27 Dec 2023 18:56:45 +0200 Date: Wed, 27 Dec 2023 18:56:45 +0200 From: Andy Shevchenko To: Markus Elfring Cc: linux-mmc@vger.kernel.org, kernel-janitors@vger.kernel.org, Dmitry Torokhov , Greg Kroah-Hartman , Paolo Abeni , Ulf Hansson , Yang Yingliang , LKML , cocci@inria.fr Subject: Re: [PATCH] mmc: mmc_spi: Adjust error handling in mmc_spi_probe() Message-ID: References: <2aa6bd31-f3d8-41ac-abf1-9ec7cf7e064b@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 Content-Transfer-Encoding: 8bit In-Reply-To: <2aa6bd31-f3d8-41ac-abf1-9ec7cf7e064b@web.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Dec 27, 2023 at 12:50:50PM +0100, Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 27 Dec 2023 12:23:20 +0100 > > The kfree() function was called in one case by > the mmc_spi_probe() function during error handling > even if the passed variable contained a null pointer. > This issue was detected by using the Coccinelle software. > * Thus return directly after a call of the function “kmalloc” failed > at the beginning. > > * Move an error code assignment into an if branch. How is this one better? -- With Best Regards, Andy Shevchenko