linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Yang Li <abaci-bugfix@linux.alibaba.com>, hannes@cmpxchg.org
Cc: mhocko@kernel.org, vdavydov.dev@gmail.com,
	akpm@linux-foundation.org, cgroups@vger.kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memcontrol: remove redundant NULL check
Date: Tue, 2 Feb 2021 11:12:05 +0100	[thread overview]
Message-ID: <187faa43-dc1c-d0a9-769c-b8d99b954c32@redhat.com> (raw)
In-Reply-To: <1611216029-34397-1-git-send-email-abaci-bugfix@linux.alibaba.com>

On 21.01.21 09:00, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./mm/memcontrol.c:451:3-9: WARNING: NULL check before some freeing
> functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
> ---
>   mm/memcontrol.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 605f671..f6a561b 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -447,8 +447,7 @@ static void memcg_free_shrinker_maps(struct mem_cgroup *memcg)
>   	for_each_node(nid) {
>   		pn = mem_cgroup_nodeinfo(memcg, nid);
>   		map = rcu_dereference_protected(pn->shrinker_map, true);
> -		if (map)
> -			kvfree(map);
> +		kvfree(map);
>   		rcu_assign_pointer(pn->shrinker_map, NULL);
>   	}
>   }
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2021-02-02 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  8:00 Yang Li
2021-02-02 10:12 ` David Hildenbrand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=187faa43-dc1c-d0a9-769c-b8d99b954c32@redhat.com \
    --to=david@redhat.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox