Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526718pxf; Mon, 15 Mar 2021 11:31:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIk0ANVdmMNRiHKDVUISDl8wbmwfmD+NxI+K1IZsOdUtzxNszBlHnQjnRTnGpnXYr9/6k+ X-Received: by 2002:a17:906:d153:: with SMTP id br19mr24638240ejb.360.1615833103724; Mon, 15 Mar 2021 11:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833103; cv=none; d=google.com; s=arc-20160816; b=TuS9X/nSAC6RtVUhSesBEFjYGg9ezp6cwgR06e5QuhPsnNtb0k7RZwf6j4kwMXTJx5 Hv+Mz0KADWiQ93mrHlVWfpOuxoEVjNun4eKE0n7A4j9f+E+LPIBhgTY8skyhLtqJMODN q3lvCwwNAVfBpcb9oUOGGuG+nSklF0YO+ZEYD0HhOjjXiYkb82PfijNHoNmQce25xJrv KB5MeSDdNnsPOLUZztYM9LNu0p2+EwHWyE45LgBTa8jmhfkdbv8/jtkjhG/dMUclnqFP spGNk2EcszGegDbJ0haPT+y6pgdDSOZ8jJcEFGRMaLw+/+KNozvyBHp2KOLf4OyBaawr qncA== 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=qgGO8Hb/ocqg9Gf9IN1kSUsOCUJ2B7Sgl1Mc9ZpWRMmf9Cj7cXYeO5RwpBIjqCFlHR fSa0TJweuxXpBi8ZRDngiUXdX+R0kH7UZABMzd9yqNk9OeFDjJ3mNr1lmF6uPaLqcpuQ pZS7ZU3qjEZ+k3JmM32R58W3WZnPjbCj908vLH7tT93WycogSEL3YhvBHYLDDKLMe0lQ SOiQPWVos9kLFDmN/fp8MBgMu51UNvUsMr88TULRaEo3pthU5mP32fWFSQhSRXhlz8kV O44hZ9B5V24MKwuCCnkB6cZShoI/U0cbms3zq/8bVmwbXVeGgVl2N+ipv81hKeZTo/Lc qOyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kBI/H3ff"; 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 bd28si10891416edb.570.2021.03.15.11.31.21; Mon, 15 Mar 2021 11:31:43 -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="kBI/H3ff"; 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 S240103AbhCOOhU (ORCPT + 99 others); Mon, 15 Mar 2021 10:37:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:47742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbhCOOBs (ORCPT ); Mon, 15 Mar 2021 10:01:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAC7264E89; Mon, 15 Mar 2021 14:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816907; bh=nzF2+Ac+ZX7dpNx3h28V4HmbX4N/sSYTFFXDDkmkFwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBI/H3ffjZO+YtXafmb/kQdFkdM68RGtDqQgy1OwN/Vo/+rLJNf+B0HJwAz8nUKqc +J+LVw0f2O0LAoXZnWERR/Wtq4OjhEI+WE80ldPYQTJUs/al8Z0plnlYq6G9sizAEo HSVnYtr+SLKkS+OKIIvVdVIjcxcEfwjqkQYBwseo= 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.11 194/306] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe() Date: Mon, 15 Mar 2021 14:54:17 +0100 Message-Id: <20210315135514.181530714@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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; }