From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751124AbeAVP4J (ORCPT ); Mon, 22 Jan 2018 10:56:09 -0500 Received: from mail-qt0-f174.google.com ([209.85.216.174]:36888 "EHLO mail-qt0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbeAVP4I (ORCPT ); Mon, 22 Jan 2018 10:56:08 -0500 X-Google-Smtp-Source: AH8x226zKgjaJ3Fgn1optRszKZ/+ZvnqtxM2sqdwzepu0xYctFsV7eScRI6NnkKfC45KHNWMDjDdQA== Date: Mon, 22 Jan 2018 07:55:59 -0800 From: Tejun Heo To: Xiongwei Song Cc: guro@fb.com, longman@redhat.com, davem@davemloft.net, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, sxwjean@gmail.com Subject: Re: [PATCH] cgroup: remove incorrect check on the return value of css_alloc Message-ID: <20180122155559.GC1096857@devbig577.frc2.facebook.com> References: <20180122133851.19772-1-sxwjean@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180122133851.19772-1-sxwjean@me.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Jan 22, 2018 at 09:38:51PM +0800, Xiongwei Song wrote: > The function css_alloc never return NULL, it may return normal pointer or It's a calling a controller implemented method. I'd much rather keep the extra protection. > error codes that made by ERR_PTR, so !css is always false, we need use > IS_ERR to check it, and if this is true, we should use ERR_CAST handle it. It's of the same type. Why would it need casting? Thanks. -- tejun