Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6910694rdb; Tue, 2 Jan 2024 19:34:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqzeixuQVmhyvzDCPFnfpon6w4yWrleZ5+ZgU563ESwywLCVCiXz/9J32lCY+KN40M3/fM X-Received: by 2002:a05:6808:f11:b0:3bc:12f0:2f78 with SMTP id m17-20020a0568080f1100b003bc12f02f78mr3173822oiw.33.1704252867916; Tue, 02 Jan 2024 19:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704252867; cv=none; d=google.com; s=arc-20160816; b=FIHj4A165W83Tvj0gAFbu3I+Xrad+nceH7dgyD0hKx7oMcC4Xdg1QGoKZPiQ+wlwSO XfwKa0sO/OXok1pKpZ7rotJd9vyAwSJ7K3YZpX1XZIuPnjql7bvDwWR0uGFIWIWkBjvL HeLYRbKs3pnym6KSJVbdgj/GkKo17xTarmaChlzmnJdg5d+9aiGbYztzu7eth86in/OY FJrZHsUljNeQ6gpu9wW2Xr451KxC4Xo0t8S0ZZwql9LrNs6HiqHdq0NdSYQ11nEFNPTr Waj7UR5V/gBaC2/wpO3QwqRRH46Y56C/hQjOm3/I58ag6PdOI6hdIvgPU7Yz0DzUyoXI Kppw== 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; bh=mJNmSMHJ6VyhHqQk5xsLaaaKGkW2B8mkZHC44azOtCU=; fh=IPUyKtz2dIHXDP/KdMbotZl6e0KYjn3vMrifYL9TZzs=; b=Xr5+P5DYNjojtH7q3a1ePGdTC5KYm9LscbFaHUUvTw2i8VOG2SUBSwImYU+nupJLFt KRGRYeUmGQXs+s3fui8F3R6ISXFkFWG5IYuPsyv1/ReOdHHDX2huxOFunj+pebCH90IB cE80Kw4tT8GLQ/67bVpNwZB44RcM1Q+bzzTH9L4UkSe8JwdAhfcqp4LmfoE+cSZLK1Da 9Gu5iG9ZTUhEY/jObv41u1gppDmF0ItmhTNFQjfr92IRIfwbDfqDEXEghXmRHb9C6FGs SC6RHaTVkrucI9cFf3eG4e3xZ4pblN1hiQkE7csFvQUCsgMlfIUPueLtkY2eHq+n5R8+ jN3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lPERcpUv; spf=pass (google.com: domain of linux-kernel+bounces-15136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n21-20020a6563d5000000b005c684e1f2ecsi21112534pgv.400.2024.01.02.19.34.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 19:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lPERcpUv; spf=pass (google.com: domain of linux-kernel+bounces-15136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 948472846C9 for ; Wed, 3 Jan 2024 03:34:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 590681119C; Wed, 3 Jan 2024 03:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lPERcpUv" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7C13817980; Wed, 3 Jan 2024 03:34:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E784BC433C7; Wed, 3 Jan 2024 03:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704252855; bh=crfu/A0uKyvBIlvYcV6K1Hvp0K01b3WuW61+LgN4slI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lPERcpUvn8en32iPt3b9KWvf31zof5f9g4wtcK7sUgDlK6dPubDQLPCuUj6TOM3pP 2xmEMkgrCljY9+1rfxIw3+gxCY+9Mr5oALBcxZvK4Kj3Zdq4fyygIuQO4N7UyTGVe2 UXkuqv+QRw2DO8H81UQkaA0zzyWCbEuNoRi0fj8TBOWdEkbASJ8gLleCAxjQsJmS8D pbDhej0Rt4/q1mddh3GQeYf5mjMhFFaA43USdVLJR2YH3hQa3IcducoolZuvYr5kA9 2rD6oE5vbu0RFvJxrsFkGItCfUvNdxUIrYu9Yn8aT5KxzoeeRDlKiQTu5uhT7Vr6JG NTOQMPVJcdC6Q== Date: Wed, 3 Jan 2024 11:34:12 +0800 From: Tzung-Bi Shih To: Markus Elfring Cc: chrome-platform@lists.linux.dev, kernel-janitors@vger.kernel.org, Benson Leung , =?iso-8859-1?Q?G=FCnter_R=F6ck?= , LKML Subject: Re: [PATCH] platform/chrome: cros_ec_i2c: Less function calls in cros_ec_cmd_xfer_i2c() after error detection Message-ID: References: <5db36d2b-afe0-4027-b22e-ded163a409be@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=us-ascii Content-Disposition: inline In-Reply-To: <5db36d2b-afe0-4027-b22e-ded163a409be@web.de> On Thu, Dec 28, 2023 at 08:56:38AM +0100, Markus Elfring wrote: > The kfree() function was called in up to two cases by > the cros_ec_cmd_xfer_i2c() function during error handling > even if the passed variable contained a null pointer. > This issue was detected by using the Coccinelle software. > > * Adjust jump targets. > > * Delete two initialisations which became unnecessary > with this refactoring. The patch saves few instructions but makes the code less readable a bit. I would prefer to leave the code as is or wait for other reviewers' input.