From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbeAVXVr (ORCPT ); Mon, 22 Jan 2018 18:21:47 -0500 Received: from mr28p48im-tydg10113601.me.com ([17.110.88.45]:29968 "EHLO mr28p48im-tydg10113601.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbeAVXVo (ORCPT ); Mon, 22 Jan 2018 18:21:44 -0500 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-22_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1801220311 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] cgroup: remove incorrect check on the return value of css_alloc From: Xiongwei Song In-reply-to: <20180122155559.GC1096857@devbig577.frc2.facebook.com> Date: Tue, 23 Jan 2018 07:21:36 +0800 Cc: guro@fb.com, longman@redhat.com, davem@davemloft.net, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, sxwjean@gmail.com Content-transfer-encoding: 7bit Message-id: <352F18C3-8039-4636-84EB-58FE457CA455@me.com> References: <20180122133851.19772-1-sxwjean@me.com> <20180122155559.GC1096857@devbig577.frc2.facebook.com> To: Tejun Heo X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 22 Jan 2018, at 11:55 PM, Tejun Heo wrote: > > 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? Okay, Thanks for your comment. Apologies for the noise. Thanks Xiongwei > > Thanks. > > -- > tejun