Received: by 10.223.176.46 with SMTP id f43csp3068417wra; Mon, 22 Jan 2018 07:57:09 -0800 (PST) X-Google-Smtp-Source: AH8x226ik5r7C6rQ9vWUdePy6SBB+VMPOXdXS5hn41mJUOhREcYAujcRclqInZJCkIykc0ukftXx X-Received: by 10.107.135.208 with SMTP id r77mr8784662ioi.248.1516636629038; Mon, 22 Jan 2018 07:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516636629; cv=none; d=google.com; s=arc-20160816; b=n6LQVU2WJ55NReQCHg3NQAOSKmSXUX/5jLtNJUxYT+7sVOe3zvCGwj91uuFxjAxw9v xBQmbqfPieU82sdSHMi7TIl/Jd1x/dk8op8gIWK9mRgY8fbN+Gp64pMTtjGbIeGCcbOb 2LA7Yhcu66LvOYDOdKOoFc/anKimCk+oYKXMynAdexbsEFKJ/AvDIUeSVf56R9++kcam FMxqqqLxmrJIM00lMAV2PoH7h/BiwRI3N6S+eNqBKRwJs5D54CZrwXJES3+3rbGZXhk6 cFd6IbnTYD8nXN0pY0heGsA1uV+tKhbJbb9wmVQc/w1Pi+b2HPhM3JqgISA2R0EDEdIG uPZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=kZn52uLs3RMD09XJezB5708sSxj6E/c5/GQj7dFZDVs=; b=h9KROIHDv023N3qnWPXdBF/hmQRW0xO34+69t+qEKTPx+IoxAoOwiAiZQaQL1sOiR4 3pE5Kz521H8jUaJvuSZpie2jogG7ZHTI+6r5wN2FpBwOPieXQ8fnmto6tMgDcYtf6cl9 4tjumZVbp34mNgun2aJbRQzh36Rx+E659pY4IK8nc4oCdVcqMzaMh2JCvSpP3OmuWe/l PvqF+bmCvjIbJIZ6vYCl9wHhOneup0Dr8WEkI2N4J7EyD4eymwe4FjrZjq42bbBGdydW LEqqEqoUcvQHoEYs7AHqyL0grZlzyHqrGw6FjyfHN3C1gZimyYlmOcN9uZ3GfEVpReYD iXQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WXsy/HrH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k18si13105395iod.22.2018.01.22.07.56.55; Mon, 22 Jan 2018 07:57:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WXsy/HrH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751113AbeAVP4J (ORCPT + 99 others); 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 Received: by mail-qt0-f174.google.com with SMTP id d54so21930823qtd.4 for ; Mon, 22 Jan 2018 07:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kZn52uLs3RMD09XJezB5708sSxj6E/c5/GQj7dFZDVs=; b=WXsy/HrHSLM0wmAccEbohC4s3B6it1kPEsqewINHwbRFiIoKiBn9S08XBm2LEoLCdq rloKsYWk+3FmxB3zcsKoH4yqh5kb9R0g0QGqDFoyGxP04uy1Tr7PBc+yopFXbLBPaGgm rpFWeXM2Zhk4EDDvg6uyah3ZGSTVW1WuzXSlqdvBQqdVP5Ql5xrddcZMPmKTDSFFkObJ gePlALZF6rDm12cHUoz1+YHxPEt9VHCAo8K/8Zid6N3fF6zG+R/jhYWS+8V1wV7jfjXH 8tVAsLyKbYvbmQTuXLOSa09d1A67XbyhZXiLHs5nEw1P9sbf8CwvFvUoxA240uduqI+m VDdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=kZn52uLs3RMD09XJezB5708sSxj6E/c5/GQj7dFZDVs=; b=OLUtLv2V+jKw7oQ7fp3op43rqy2YHgnizzIpyUDaaN0ZeXclbDhnEjTxALxlYrxDVo Mmsc09WTD7b6851bCarbNstViIR8xR06ySFKvsdJFo+Cpf0ZBFUJYvhE1gMmlwGRxMjR mGYVCUwHTP8YiiCLVghN6vhU6o50K8GyLKC0aCEbay5kMnQfb2jmuF9Sz3vcUiPZn+KP IX6Z7RVZMSMxaC0+hkBd+6P8lzQTAhH5Xj92ehUhB+OWsdF43E5wcWT03uEUQfxFxuVF b/C8iqIonWFZeRMX8TQ7KKlsejfYgVzfFtlB5n9eJo8s41ov+Fyx1+crZft0/H0F9H2v 6Wbw== X-Gm-Message-State: AKwxytcnbM9EZ68nz3bJpR59wPu9GWOtbeBiXQkkSiC8SHCEkWLod0tx dH49g0749yut9eu085dwMjU= X-Received: by 10.55.140.130 with SMTP id o124mr9743398qkd.120.1516636567582; Mon, 22 Jan 2018 07:56:07 -0800 (PST) Received: from localhost (dhcp-ec-8-6b-ed-7a-cf.cpe.echoes.net. [72.28.5.223]) by smtp.gmail.com with ESMTPSA id r6sm10198110qkd.41.2018.01.22.07.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 07:56:06 -0800 (PST) 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 Precedence: bulk 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