Message ID | 20221129084329.92345-1-zys.zljxml@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp214006wrr; Tue, 29 Nov 2022 00:51:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CVPTwMK+s0Koc4BGdP6YUFdZnCwSMywwsh8AxJ30ee85/CJ/bwfjYMab65E2/P5ojjbIH X-Received: by 2002:a05:6a00:1d0b:b0:574:24cc:8aa7 with SMTP id a11-20020a056a001d0b00b0057424cc8aa7mr33634838pfx.45.1669711912329; Tue, 29 Nov 2022 00:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669711912; cv=none; d=google.com; s=arc-20160816; b=VjJlR3HoxPs5O2JR7qxwfEJjhIKNAl25jLZUQiO55cMbj4Q1YpvLLbdJUjV4PwD7cx 8SopP/sw2QpkzHE9fnUC7ZPqbfWjltGcxmzDBJm+rDVQCbP8HbeF7k9AVKVbQBSnQ2Za 9mYy6OYSvzv6XLq5Ar4qKd7pIylsYCWMv7UQ8JG2A99Eq8fEXgSva0loaWtbGSklKdAg uPPtJrgcdYM4qnoFUjQ/5hNEwVdSp/MLY/FwcFEwDJocGcNIGonb/dsTUXAR505qHVJ6 HeayiaUS8pUwXsyD0KdBxKvtOZfw2xR8qmsdh1hOcwrLjLjH+44zgrEdZtwN+7V5Fa+A a9Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=C8hpJ+dhKLwcq6yGKXl9JYCXBoLbIiY9R+toMXs7xSY=; b=JAe2/z/ykY7Uy4E46tlpWj/fz1hrQ2x4xSUqFm53CoGdSLLZ/H6bRSYLpJidtD9fK4 S7eYmFVBZHKl8fGYUae6OwMDGU0neV6r7kAZ/rsrJEPeqBuon7dDQErjZ/r7t7ceS9eJ oJ8LlykR2HOhqMPNw20Nd6jt9gN6BKFBdLYoHRjxnJt0x1c0rwF1IUCFbsz6JrKgwBAR VYgwXDPU1rPE6l8MwARcQzTHnCIUHJUCuSYJH5T4qJEbg1HPXBtF7KC4GKcsMgryvzVH Uup2k6AlTR0Q8QOJUfkbEvlTxTgOPkG5QiXdOmNXO4bl2X2ZEg4iDagfrtQ9JrDCDu31 tssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wn34m7pM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r207-20020a632bd8000000b0046b127a1e8bsi14139771pgr.488.2022.11.29.00.51.39; Tue, 29 Nov 2022 00:51:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wn34m7pM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbiK2IoA (ORCPT <rfc822;rbbytesnap@gmail.com> + 99 others); Tue, 29 Nov 2022 03:44:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbiK2Ins (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 29 Nov 2022 03:43:48 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFEF6209B6; Tue, 29 Nov 2022 00:43:47 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id o12so4172661pjo.4; Tue, 29 Nov 2022 00:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=C8hpJ+dhKLwcq6yGKXl9JYCXBoLbIiY9R+toMXs7xSY=; b=Wn34m7pMHKu6xKX53fvwxU5LRDQO6C7CFeyqdkMEcUFpDIoGxu5z/PT+zprrv2yBDM Iur2TvUMe3TzMqsQk7tuM+HbfbQeB75yrTY7neVOR63rb14hapYpEiaOeQx5m7FW37i5 iy5N74gAONSDkaaSiH7NcamTyyC/Y8p9GNbqnB+otKAW1zRi0gZaOBCOZVvZF7kE4x4b 3By19zZKLeB3d441YtofIeOozwFOFFarkUeDIEmOGtqWovaa1eZ4o5+NcyGMVwdgj11o LFXo25fnU7zHPGwZF3TfE0BFOedsbNWIEp2zy6Ver2MLoPg1PX2v0/TWgIPcqFlIfnAS iX+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C8hpJ+dhKLwcq6yGKXl9JYCXBoLbIiY9R+toMXs7xSY=; b=8FqTABRr1guTgcsgCjomwNS32MjdSNZ+JgmsB3R7WLm/jFxXN6vnSruy6e+MEr3ZZ4 zIGbnGvb9/Z2Rauny5Ge6ncJiNXrxv7fRh4qnKpIY4CJcxs42K1c4fjSgmLbgT8+klM1 iaUYMoFWSvPHvb0aPdfmCTmSB/VvT4vSYg6G0DmNiEJYijiofhzfCRP/FtFwJekVZJm+ yCwjTujJAsDJwCHfaZD86OkD0lr9lZb1eX4wsqHmoqfAQs64XizYvDdCK3aftrCDrdBz +kp95EqG7g9PVRGK4lRU3HUUn5j5YPu6L9CDn3tx8wihzKDxrCTrNywW2NeLoFNhUpQz EEpA== X-Gm-Message-State: ANoB5plZTYFvlzp77tlh6uD6zmKtap4ugOVKDGgtzJ6YHHtpspM6ZafS dA6rkMTELrI8RdGooYkD3eY= X-Received: by 2002:a17:90a:db52:b0:212:d2c2:8e1a with SMTP id u18-20020a17090adb5200b00212d2c28e1amr65321764pjx.54.1669711427518; Tue, 29 Nov 2022 00:43:47 -0800 (PST) Received: from localhost.localdomain ([43.132.141.3]) by smtp.gmail.com with ESMTPSA id o6-20020a62f906000000b00574345ee12csm9387640pfh.23.2022.11.29.00.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 00:43:46 -0800 (PST) From: zys.zljxml@gmail.com To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yushan Zhou <katrinzhou@tencent.com> Subject: [PATCH] net: tun: Remove redundant null checks before kfree Date: Tue, 29 Nov 2022 16:43:29 +0800 Message-Id: <20221129084329.92345-1-zys.zljxml@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750819838110407801?= X-GMAIL-MSGID: =?utf-8?q?1750819838110407801?= |
Series |
net: tun: Remove redundant null checks before kfree
|
|
Commit Message
Katrin Jo
Nov. 29, 2022, 8:43 a.m. UTC
From: Yushan Zhou <katrinzhou@tencent.com> Fix the following coccicheck warning: ./drivers/gpu/host1x/fence.c:97:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Yushan Zhou <katrinzhou@tencent.com> --- drivers/gpu/host1x/fence.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
+ Thierry Reding, linux-tegra, dri-devel On Tue, Nov 29, 2022 at 04:43:29PM +0800, zys.zljxml@gmail.com wrote: > From: Yushan Zhou <katrinzhou@tencent.com> > > Fix the following coccicheck warning: > ./drivers/gpu/host1x/fence.c:97:2-7: WARNING: > NULL check before some freeing functions is not needed. > > Signed-off-by: Yushan Zhou <katrinzhou@tencent.com> Hi, the change in the patch looks good to me. However, it does not appear to be a networking patch, so I think you have sent it to the wrong place. With reference to: $ ./scripts/get_maintainer.pl drivers/gpu/host1x/fence.c Thierry Reding <thierry.reding@gmail.com> (supporter:DRM DRIVERS FOR NVIDIA TEGRA) David Airlie <airlied@gmail.com> (maintainer:DRM DRIVERS) Daniel Vetter <daniel@ffwll.ch> (maintainer:DRM DRIVERS) Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING FRAMEWORK) "Christian König" <christian.koenig@amd.com> (maintainer:DMA BUFFER SHARING FRAMEWORK) dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR NVIDIA TEGRA) linux-tegra@vger.kernel.org (open list:DRM DRIVERS FOR NVIDIA TEGRA) linux-kernel@vger.kernel.org (open list) linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK) linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK) And https://lore.kernel.org/dri-devel/39c44dce203112a8dfe279e8e2c4ad164e3cf5e5.1666275461.git.robin.murphy@arm.com/ I would suggest that the patch subject should be: [PATCH] gpu: host1x: Remove redundant null check before kfree And you should send it: To: Thierry Reding <thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org > --- > drivers/gpu/host1x/fence.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c > index ecab72882192..05b36bfc8b74 100644 > --- a/drivers/gpu/host1x/fence.c > +++ b/drivers/gpu/host1x/fence.c > @@ -93,8 +93,7 @@ static void host1x_syncpt_fence_release(struct dma_fence *f) > { > struct host1x_syncpt_fence *sf = to_host1x_fence(f); > > - if (sf->waiter) > - kfree(sf->waiter); > + kfree(sf->waiter); > > dma_fence_free(f); > } > -- > 2.27.0 >
On Wed, Nov 30, 2022 at 9:57 PM Simon Horman <simon.horman@corigine.com> wrote: > > + Thierry Reding, linux-tegra, dri-devel > > On Tue, Nov 29, 2022 at 04:43:29PM +0800, zys.zljxml@gmail.com wrote: > > From: Yushan Zhou <katrinzhou@tencent.com> > > > > Fix the following coccicheck warning: > > ./drivers/gpu/host1x/fence.c:97:2-7: WARNING: > > NULL check before some freeing functions is not needed. > > > > Signed-off-by: Yushan Zhou <katrinzhou@tencent.com> > > Hi, > > the change in the patch looks good to me. > However, it does not appear to be a networking patch, > so I think you have sent it to the wrong place. > > With reference to: > > $ ./scripts/get_maintainer.pl drivers/gpu/host1x/fence.c > Thierry Reding <thierry.reding@gmail.com> (supporter:DRM DRIVERS FOR NVIDIA TEGRA) > David Airlie <airlied@gmail.com> (maintainer:DRM DRIVERS) > Daniel Vetter <daniel@ffwll.ch> (maintainer:DRM DRIVERS) > Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING FRAMEWORK) > "Christian König" <christian.koenig@amd.com> (maintainer:DMA BUFFER SHARING FRAMEWORK) > dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR NVIDIA TEGRA) > linux-tegra@vger.kernel.org (open list:DRM DRIVERS FOR NVIDIA TEGRA) > linux-kernel@vger.kernel.org (open list) > linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK) > linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK) > > And https://lore.kernel.org/dri-devel/39c44dce203112a8dfe279e8e2c4ad164e3cf5e5.1666275461.git.robin.murphy@arm.com/ > > I would suggest that the patch subject should be: > > [PATCH] gpu: host1x: Remove redundant null check before kfree > > And you should send it: > > To: Thierry Reding <thierry.reding@gmail.com> > Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org > > > --- > > drivers/gpu/host1x/fence.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c > > index ecab72882192..05b36bfc8b74 100644 > > --- a/drivers/gpu/host1x/fence.c > > +++ b/drivers/gpu/host1x/fence.c > > @@ -93,8 +93,7 @@ static void host1x_syncpt_fence_release(struct dma_fence *f) > > { > > struct host1x_syncpt_fence *sf = to_host1x_fence(f); > > > > - if (sf->waiter) > > - kfree(sf->waiter); > > + kfree(sf->waiter); > > > > dma_fence_free(f); > > } > > -- > > 2.27.0 > > Apologies for the mistake... I'll resend it to the correct place. Thanks for your reminder, anyway. Best, Katrin
diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c index ecab72882192..05b36bfc8b74 100644 --- a/drivers/gpu/host1x/fence.c +++ b/drivers/gpu/host1x/fence.c @@ -93,8 +93,7 @@ static void host1x_syncpt_fence_release(struct dma_fence *f) { struct host1x_syncpt_fence *sf = to_host1x_fence(f); - if (sf->waiter) - kfree(sf->waiter); + kfree(sf->waiter); dma_fence_free(f); }