Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759335AbbGHQLQ (ORCPT ); Wed, 8 Jul 2015 12:11:16 -0400 Received: from mx2.parallels.com ([199.115.105.18]:52374 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759319AbbGHQLM (ORCPT ); Wed, 8 Jul 2015 12:11:12 -0400 Date: Wed, 8 Jul 2015 19:11:01 +0300 From: Vladimir Davydov To: Michal Hocko CC: Johannes Weiner , Andrew Morton , Tejun Heo , Oleg Nesterov , Greg Thelen , KAMEZAWA Hiroyuki , KOSAKI Motohiro , , LKML , Michal Hocko Subject: Re: [PATCH 6/8] memcg, tcp_kmem: check for cg_proto in sock_update_memcg Message-ID: <20150708161101.GF2436@esperanza> References: <1436358472-29137-1-git-send-email-mhocko@kernel.org> <1436358472-29137-7-git-send-email-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1436358472-29137-7-git-send-email-mhocko@kernel.org> X-Originating-IP: [81.5.99.64] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 916 Lines: 20 On Wed, Jul 08, 2015 at 02:27:50PM +0200, Michal Hocko wrote: > From: Michal Hocko > > sk_prot->proto_cgroup is allowed to return NULL but sock_update_memcg > doesn't check for NULL. The function relies on the mem_cgroup_is_root > check because we shouldn't get NULL otherwise because > mem_cgroup_from_task will always return !NULL. > > All other callers are checking for NULL and we can safely replace > mem_cgroup_is_root() check by cg_proto != NULL which will be more > straightforward (proto_cgroup returns NULL for the root memcg already). > > Signed-off-by: Michal Hocko Reviewed-by: Vladimir Davydov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/