Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3819567iob; Tue, 17 May 2022 07:53:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3/lmUBbE2ydyvmybqN67DOnI/Z4O+/zIet8oymG0ESX6LRF4siZFmJhjOFlPMy5A+vxLo X-Received: by 2002:a05:6402:2217:b0:42a:a6b8:f5d2 with SMTP id cq23-20020a056402221700b0042aa6b8f5d2mr15395493edb.421.1652799181236; Tue, 17 May 2022 07:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652799181; cv=none; d=google.com; s=arc-20160816; b=rtjoYTKlKTgFAft70TsCto9SmkmDxlRv5vEkc4wSqccQZDj4Bdn47fyYU0KtttFnXW Nk8AXMm4A2W7nYTrfhcIrtNDdp7E6FopRAlX2Q5yECexEIe6dTVKs/9Fy9rb5YmAKt4+ ZFZH28VNNCp4xvyg+n73kbVRxDYhf//nwYnhkOpM4f162CaFzDZmfgMRZTEUOxZU7NzR UoBlcF5boETyLlfJXxKsesHdZ93ns2YGdisU37xACEdkH0WNTo0xZKKWO6L4YmFQ7Uw/ CbmbQfiqWuhhaa95p5yfdpTUU0z1IhOwV0hTf0HkWmLBKsEy7NN4aV3Tv4F7e0J0udHe +Iow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cIU8ZP6dP/yqtHpTSkgqKQUjvklciy5pen42UXjtUgc=; b=q45hub4jG8oh8brZhBwmn8HxTF6gDK1iomCV95EhnV/Gwg/vCf4atIJwKw8bRlOEe5 6NZ59O1x32m21Ua5/WUNhZq4egfbKq2PYfzuJ2i5dyd8Alid4UQkJM50NyOK+pL3U/4q JdB4JPYMF7OcNoorn2qfgyj0PQCYTCbILeKGkT8vvAmNPhhlI/HTP/zM65dG+HC6xHp/ 4X0qPtIIGvF26lcAInAE3c3iW73UcbmkcGXPD3RIqRlovVqNuBvv4LLaCG+Rzavo7JYl SO66CnGGc//vrDXCZfG2IdKOzrw10WGE2HtQPs/Cx/duiFO7di0htzId4Jpe5JSJ+4kT GhYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T0YJG1Vb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb8-20020a170907960800b006e8d12994c7si3115830ejc.395.2022.05.17.07.52.34; Tue, 17 May 2022 07:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T0YJG1Vb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245021AbiEQJlC (ORCPT + 99 others); Tue, 17 May 2022 05:41:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245104AbiEQJlA (ORCPT ); Tue, 17 May 2022 05:41:00 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F4633D48F; Tue, 17 May 2022 02:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652780458; x=1684316458; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4LPo/fqfv4brQeDZi/w/on11+gURa50LBTaOEz91bA0=; b=T0YJG1Vb8/2nPWxM5KFyElCRWD/4MGvGgDqeKK/iknHbEZIuE6un0IDw GZ0H3NWnv2jlwZvfgZqNYy1KK296ArKHyzj0cTdQ9Dwki4N0Gw9g/mbbP kTjHW4q7YWj0kc3ybXEH0KqN2eiTlYH8uyWMlc2CjfDtXHDYFsfth/7Aa bhBq2X5GOVSxj6PHDR7T735I8b4rmwZa6AXFqAEjWrd0GRlOupz71MowG DE4dyUnETuDsxY1WhBum8y0f0xsHHdU/VoohAPSBBbUyg50R9bgrbWMy3 Wmce9sfmsMEcAXUTpkwsXlljS3Q47rGPjknJC2XN2oML+EyFcpT5gXhF3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="253179278" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="253179278" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 02:40:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="713778250" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 17 May 2022 02:40:55 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 17 May 2022 12:40:54 +0300 Date: Tue, 17 May 2022 12:40:54 +0300 From: Heikki Krogerus To: Yang Yingliang Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH -next] usb: typec: ucsi: fix return value check in ucsi_acpi_probe() Message-ID: References: <20220516131527.999909-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220516131527.999909-1-yangyingliang@huawei.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 16, 2022 at 09:15:27PM +0800, Yang Yingliang wrote: > If memremap() fails, it never returns NULL. Replace NULL check > with IS_ERR(). There's already a fix pending for this: https://patchwork.kernel.org/project/linux-usb/patch/YnjaDBXLmwouCB3M@kili/ thanks, > Fixes: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()") > Reported-by: Hulk Robot > Signed-off-by: Yang Yingliang > --- > drivers/usb/typec/ucsi/ucsi_acpi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c > index 7455e3aff2be..8873c1644a29 100644 > --- a/drivers/usb/typec/ucsi/ucsi_acpi.c > +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c > @@ -133,8 +133,8 @@ static int ucsi_acpi_probe(struct platform_device *pdev) > } > > ua->base = devm_memremap(&pdev->dev, res->start, resource_size(res), MEMREMAP_WB); > - if (!ua->base) > - return -ENOMEM; > + if (IS_ERR(ua->base)) > + return PTR_ERR(ua->base); > > ret = guid_parse(UCSI_DSM_UUID, &ua->guid); > if (ret) -- heikki