Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2869423rwb; Mon, 15 Aug 2022 13:00:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR67VWW/Ag6GFj6VvXp2Vm0AZDL544CwekniPOzgXC0snbHm4+krLuUVNEzSpcM7YIzHZQl7 X-Received: by 2002:a17:906:dc89:b0:731:67eb:b60b with SMTP id cs9-20020a170906dc8900b0073167ebb60bmr11056007ejc.614.1660593620627; Mon, 15 Aug 2022 13:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660593620; cv=none; d=google.com; s=arc-20160816; b=RPnqXI4ychvX45Zip8UeWVsUHwyVZc5Dl8c6dkDkQ4RUuIvWfzlQMI74/Xh/Kvzbx2 EfKV5ZIzPnqjHqT5iVDLoHSL7HnKa+OZyiBrh+9eyF5q3Z2OzkboMZ3du3BbUqb/2bMw zIyDYK2IjDJAdaUFO12a8k72dsKVxXGquojBCXT1oew+XXpSOoMU4OXCWd9lj5RGVaiV lc+Jm17RgC8lk+zzqOASNeU6ob7TEYoT518tmaP73/b8gxBwjEf98xNTON5YoJ4q/jAi E0xDGB2lHLahglf6zGJpH+P2Q5EGqAoFCiVGgX9IxjEPq74L5QjmostQJpPWR1lwREpr 7jPA== 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=WI6SBvtAhRUdKyy9s+7IW1pmviLAO4zVop8iTuh+rK4=; b=rwxQfc2PAAxdRxhtEi//+ozYkE0CZpXSY/QdKdVgyT2RiWY6YmjOuMVR8lttZ7eQwG hxzvlYGOeiW1HoYsuSCirJo5vGXvyAnwK4Bdn+5uMYv2engxMpP16jYgUdw3h18Dr/sy lPXAOWZCz5INI4cPBeid9fieaVIjtH5qgDzjutafPWvqDxjKVmC9NwiHLiG0phP0L8KO DH0VuuPWEEmElEGlssGLAaXqPAjo710iQPZZkZwhGOfEyX3ZnAHADjt9rEcsPOEsAmaY ridNSCipOb4awqVWXxPZiWIuH7v3Hsd2pCewb+KUNE87Xkh8KgN1QXafcBjBWGhG4HBa Ns6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IEOWEzZL; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a94-20020a509ee7000000b0043be6506057si8542406edf.182.2022.08.15.12.59.55; Mon, 15 Aug 2022 13:00:20 -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=@linuxfoundation.org header.s=korg header.b=IEOWEzZL; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239854AbiHOSS5 (ORCPT + 99 others); Mon, 15 Aug 2022 14:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239768AbiHOSSP (ORCPT ); Mon, 15 Aug 2022 14:18:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0E622AC72; Mon, 15 Aug 2022 11:15:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 73D45B80F99; Mon, 15 Aug 2022 18:15:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B33D7C433C1; Mon, 15 Aug 2022 18:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587336; bh=Muz+6devd5UaSOJcMQZ9LRIIl260cRIsDAwDtiF54MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IEOWEzZL325wHuNsKLTWQ+wJbcFpuwV1RUg3QSBlq1kDbtkLcK5nMXwrvQfHvKZiL dLXaglrG1hMcnPM1OVjeM7TFm6bbEZ6zSly3NcddCVC7tA3D7yAIJzgSdUfySfVo6E fnYnkc1SN+O8kk/ovYjgr8OcJKJbosOgPDp/rgvE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , William Dean , Helge Deller Subject: [PATCH 5.15 051/779] parisc: Check the return value of ioremap() in lba_driver_probe() Date: Mon, 15 Aug 2022 19:54:55 +0200 Message-Id: <20220815180339.461010784@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: William Dean commit cf59f34d7f978d14d6520fd80a78a5ad5cb8abf8 upstream. The function ioremap() in lba_driver_probe() can fail, so its return value should be checked. Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache") Reported-by: Hacash Robot Signed-off-by: William Dean Signed-off-by: Helge Deller Cc: # v5.6+ Signed-off-by: Greg Kroah-Hartman --- drivers/parisc/lba_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *d u32 func_class; void *tmp_obj; char *version; - void __iomem *addr = ioremap(dev->hpa.start, 4096); + void __iomem *addr; int max; + addr = ioremap(dev->hpa.start, 4096); + if (addr == NULL) + return -ENOMEM; + /* Read HW Rev First */ func_class = READ_REG32(addr + LBA_FCLASS);