Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527806pxf; Mon, 15 Mar 2021 11:33:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+x5hlH4POQ1gdLsEwj0kbfcXzyCki05wILXGL4195CipWWL/gP04ib0fnLTiaho0AJ5Io X-Received: by 2002:a17:906:aada:: with SMTP id kt26mr24604442ejb.137.1615833189223; Mon, 15 Mar 2021 11:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833189; cv=none; d=google.com; s=arc-20160816; b=G1FiLl7VaR1ZePMXM256EQ5Yn26usN64lixlG1V5cHKxjfoxk97SMQ+QNPdFN4MUvh jwWsMSz42pyMNkA5kTIhXdSmbxgCsiNaApHVMJbV1jIZUw+PyqRAyocV99ALRfpR8eWB OpdtOSExwCH7fb70oK8MzYLQL2G9OacwtZwA8GdkqU3+DBe0cNId2KCu3XbHgAl2ftTm sC0NCbMJr+7+xD+y4AubSo8ZJw9zQJT4LIT5cqjmCmA4B6jZFkdt6+WtcWVVZ5Y8TVXx EjP63Z/JuJ8dne9XmPl9m654WImGswtylwUnwMgqG9VG/5PkJNwB6bQevMauvHO57qYL Uj/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EGzV+GL9+cQjTaL0sC5zj2fdYGAeFdWodqsYat8J33o=; b=DQ2oxe4fQExNSX19oDenE5kcMMtR1ceEQiYLLKXeoyheSEHOJ9w2Jd3BroMSUVmEjy X1WypECHv/sUzN7iEld4eM1MFa+SfFH+ODukZzrGrd1ML0pG64fBTGjRug+oLEFxJdwh kteeV3vz2DjadXhYNy2hYS05qni0MkcQnZ47cghfBVznwtm4DksRrUTCNpVFMl+8U3Aa VyBEZN3QBqKOicbSpKuj1Om7IkT6oI+5N282lhj6Pvp6bDItYO+hLMDQf44LFsUK6d1n kqbUSmpCBpDf5AxpBDHLZRGCLQLIouOAXqW2Eu5L74girKIzsftuRrX2MU5356BApW1o PWGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JvPCj6UF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si11527014ejk.400.2021.03.15.11.32.46; Mon, 15 Mar 2021 11:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JvPCj6UF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236385AbhCOOjA (ORCPT + 99 others); Mon, 15 Mar 2021 10:39:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:48932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233681AbhCOOCS (ORCPT ); Mon, 15 Mar 2021 10:02:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 531ED64F38; Mon, 15 Mar 2021 14:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816937; bh=nzF2+Ac+ZX7dpNx3h28V4HmbX4N/sSYTFFXDDkmkFwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JvPCj6UFO1rMqB6wPpqEyAsk0dC2bP/k96kEWFHWZJ1yI++25PXVw526KIaYx/qA/ k7MrRLbquT5LPTMbMxLubtWUJC+GdVP+tvZOYWK71I4VEyY7RbaiM3PwAd1KLYk1Yj 1yPGFx3snn1ryB3tjuZjLR0CnQpsMlfOJ1JCtT+c= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Arnd Bergmann , Krzysztof Kozlowski , Wei Yongjun Subject: [PATCH 5.10 198/290] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe() Date: Mon, 15 Mar 2021 14:54:51 +0100 Message-Id: <20210315135548.610064720@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Wei Yongjun commit 414c20df7d401bcf1cb6c13d2dd944fb53ae4acf upstream. In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Cc: stable Reported-by: Hulk Robot Reviewed-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210305034927.3232386-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -1773,8 +1773,8 @@ static int s3c2410_udc_probe(struct plat udc_info = dev_get_platdata(&pdev->dev); base_addr = devm_platform_ioremap_resource(pdev, 0); - if (!base_addr) { - retval = -ENOMEM; + if (IS_ERR(base_addr)) { + retval = PTR_ERR(base_addr); goto err_mem; }