Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp120793iob; Tue, 17 May 2022 20:55:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHJdRf55ewja+HyX9bZ9C+mfu9HHsAbZ1baF8khQ2GT0QvJQUV8cGU1fToTMNqgJmOh9Bd X-Received: by 2002:a05:6a00:1c53:b0:50d:5860:5b58 with SMTP id s19-20020a056a001c5300b0050d58605b58mr25391441pfw.85.1652846113430; Tue, 17 May 2022 20:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652846113; cv=none; d=google.com; s=arc-20160816; b=ABAzbDR7tBq7WTRXFpbu58/Tj/mkhCuQhBgfpiwmcoJTwvh1qDfU3Zoad+DZapFRXe /GSWW7rtcyM+Etxf3cYlTWntAtf8sc4b/gdHy0Hn7hLkJHiSQEJ2mO2DoyTUfUtxrm0V FYsMW3VB1El7TMoWNUsYDj/Tg7HPMlAc7zcBNP0dZNvNeaSLx3yfaaqp0sTVNumk2MEf OEjpMXcOcKiNZMNdSspd1V+MiM9T3+k2LULJUqqRRSfaJl4Kgz00SAXhdTM6WFNCZxWQ RZpnaBDUxIgZ/Kzl8E1nEtTMrg0PAfyLCQE1YCsSBkesjtjreYGgV8na/CxrUfcOu5mo kWAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=u1u68XBlOoqhQlGBcvLtqUGc4JmYDMhCSzrjxV3ZoEg=; b=mueVPqgBZwSOgXSc4W1qK0qry7TYdA1Ql87Um9v3XmU+k9wVAWCM8NuVRr5A1lJavx I+t7BY67FRdhzP/mN712+wyBUbq8TFZwN/GA9mmjYL7KRk+5xeiV/ZELFgtW+RzmfE0M prRCIpwsmmxgMRccqSGdD78cv4bg/N2yQ9LHSHGMif9OoLfisfuD58yzwrPnENBzgvDx 0OdFr6h+HlmxrWeElJsaO7lwRlv3AU5mrqcg10Mhg1oWHz3xlXhfQMRQwvy3dXwPUWC0 HNmdiZxIacjnKCikQDa4wlW47SiQ9monakUVF89qeHeBA4g7I+xF9+6HdjxJXVg6Z+TT Vm7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U2tyNAjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j7-20020a170902690700b0015ce3e35354si1339927plk.90.2022.05.17.20.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U2tyNAjw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4568C63501; Tue, 17 May 2022 20:35:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244570AbiEQJVt (ORCPT + 99 others); Tue, 17 May 2022 05:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237393AbiEQJUj (ORCPT ); Tue, 17 May 2022 05:20:39 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98FCA2AE17; Tue, 17 May 2022 02:20:37 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id j4so30201841lfh.8; Tue, 17 May 2022 02:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u1u68XBlOoqhQlGBcvLtqUGc4JmYDMhCSzrjxV3ZoEg=; b=U2tyNAjwqBTWVt+uAa1+1l92ZWUT0TikMXMZ4M4/JtVFfdFxf0fV4gYZwRk3ELbi8N Wt5mbUHCpbqzF/pmvr4+TicqhkEOhhVGYQM4CpCjRUDu+52esgCjvJtKyHIfWMmUVR3r p+hVAE38t1k7bQvgLQZYnlVzoWLnsqOZPS9rJvpAYAOn/mVHKc3YC5kRSHkvfHK11v2m QDerHO3Q8OWjq3Sx9eYbtzCm1qZ8DljqDmwnW0SVC+uEMiU93CZvzyXO0RItvUHJfKGy Ag593g3SqjjDxOdQjrEwdh3NZ+yV2Ry0JwMjG1CGo3JKtv6TZkzYLtMUdz6PV4t7ycet nuZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u1u68XBlOoqhQlGBcvLtqUGc4JmYDMhCSzrjxV3ZoEg=; b=gI8laU0ctJbpoBegK+D01BiorhrpO1Id6+ynXSe3xyCh4bcRhcoP1DprCZRa70jLrZ JHkLXV821EcQ6uOEY9zc6GaFJQBcwvrJbPy0R4xm8+J2vlCQQ497Uo/6rMbFY8tPFA1P B3I/sQ61UInP49aTCFEaHMDW9Cuq2AxU2CVjb8OIYOFqzVWzbDc7aMG5jHQhohhVdGfD m5xpNVlm18n4pWbbbjaUr4xWwph9nsQ6Fu7cuXOJIq0LxJ/H6C1e09jtlKldas26XC64 rlouJ65GhBt+EOjImG5Nt0OSklMiRi2izHpmG5JN/wFC9sDpPJYWdemcqFuQ3pWr7GJG n06w== X-Gm-Message-State: AOAM530ffu1n2dPkP3J9ph+PQtwamFH8wgtU/B7YhPVOQh9KollVrVN6 rjazhI1RglhYoyS+KTLbSxpau++8zPg= X-Received: by 2002:a19:a418:0:b0:473:c1af:fc9f with SMTP id q24-20020a19a418000000b00473c1affc9fmr16141770lfc.575.1652779235847; Tue, 17 May 2022 02:20:35 -0700 (PDT) Received: from [192.168.1.103] ([178.176.77.211]) by smtp.gmail.com with ESMTPSA id w1-20020a05651234c100b0047255d2118fsm1533995lfr.190.2022.05.17.02.20.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 02:20:35 -0700 (PDT) Subject: Re: [PATCH -next] usb: typec: ucsi: fix return value check in ucsi_acpi_probe() To: Yang Yingliang , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org References: <20220516131527.999909-1-yangyingliang@huawei.com> From: Sergei Shtylyov Message-ID: Date: Tue, 17 May 2022 12:20:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220516131527.999909-1-yangyingliang@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hello! On 5/16/22 4:15 PM, Yang Yingliang wrote: > If memremap() fails, it never returns NULL. Replace NULL check Oh, memremap() does! But devm_memremap() doesn't, indeed. :-) > with IS_ERR(). > > 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) MBR, Sergey