Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2261523pxp; Mon, 21 Mar 2022 15:14:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBIRSSKugWp2VhJmpDbE++37higK7X5frJgcDjMWeefN4irKkaGh+AtqzJ14zxgnbMMoai X-Received: by 2002:a17:902:e949:b0:14b:1f32:e926 with SMTP id b9-20020a170902e94900b0014b1f32e926mr14867247pll.170.1647900875623; Mon, 21 Mar 2022 15:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647900875; cv=none; d=google.com; s=arc-20160816; b=eMvrGJCWg2BWEPurJJ6NFZjiyMmiAmCpaNQERyZprZQ9qVW4hux9pdFGCVSPrcaaWh DzE1nCd9P2XaJlpqHgyjMFzZsZQ6BB7fG2wST74jVI+2920x5IvHPsGV9HxvHHiSZjLb GbzDarpsLBJVADC34VZsSlD+hKIct1AvE+VWe1WPZAqnVdMokfRzTMP57e7Bjlr2DN+0 3HCuxFeaAvpqP1AY+9ZqC7kgX0zwb3MhosoE/dMlUWso9Yu51utFNdFbm8HmItKBKzY6 QCC9cWQ1u16XU0EaMFzwy/eG11rDSsWk+2r9KSFkNjvxqhx3ncMs+68aH9Sw/8ho0tkr jLfw== 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=mjR1CqEU8k9CR5dWlydOSHL9oUM1NkB2+f2cp56F8Jw=; b=HmBebcVm4ST3QnfELb3Pvqj9ivdlzkBcou0efgKpHmi0Ba4w2j/0q0ReeZO9xS90HA N55Ica7YXILNGo175ZbgaWU6YtO2mhPjW12WAoN/sL+/TeH60XAHTCs+4hO7uCR7nM9n zPWO9AB0kC6cFkXmJNJNFwQc1fL/izjy2lwz9wGieBa7lVknEAXofQnJ2N4B6aQBOz8D Hu8A+bScr1HnoltwqrXV5JNX9rJVRFSkCbaDHlyesACqAkcd+Oe06xIqzhRc2eL2l6w5 CYjlB6fnB+H1KPpJ/BGgWPTvtnEprYQo70qPNk1X97XTupBwqDmRW1f+gBgna9iVvgRR TihQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v+Z0uuKW; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l123-20020a633e81000000b003816043ef2bsi15359043pga.288.2022.03.21.15.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:14:35 -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=@linuxfoundation.org header.s=korg header.b=v+Z0uuKW; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EEAE36FA7B; Mon, 21 Mar 2022 14:33:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348571AbiCUN6D (ORCPT + 99 others); Mon, 21 Mar 2022 09:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348431AbiCUN5A (ORCPT ); Mon, 21 Mar 2022 09:57:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 328F115DAB2; Mon, 21 Mar 2022 06:55:07 -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 98E99B816C7; Mon, 21 Mar 2022 13:55:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E78BC340E8; Mon, 21 Mar 2022 13:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647870904; bh=TkkZj9aVcrLNI81bYLasKDlzB/c1Awu5HVrJX/PLp48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v+Z0uuKWxZvEuAmP2beHhgWT9T7N6jZrqoRQZH5XSyy9CmS04t3VwgWHCRJhxhVDE TeEE/L+ALD9ucbFbJeaZKIzGkd8GJCMIfTP+wzwoTp1M34lC6ym3TLVRz6sfvwdeCU 6xDndbqlLBdOwvuVSsGGvUJcyaThDEUKbtnspTIA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TOTE Robot , Jia-Ju Bai , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 12/57] atm: firestream: check the return value of ioremap() in fs_init() Date: Mon, 21 Mar 2022 14:51:53 +0100 Message-Id: <20220321133222.342173946@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133221.984120927@linuxfoundation.org> References: <20220321133221.984120927@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 From: Jia-Ju Bai [ Upstream commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 ] The function ioremap() in fs_init() can fail, so its return value should be checked. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/firestream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index ef395b238816..f7880012b9a0 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1692,6 +1692,8 @@ static int fs_init(struct fs_dev *dev) dev->hw_base = pci_resource_start(pci_dev, 0); dev->base = ioremap(dev->hw_base, 0x1000); + if (!dev->base) + return 1; reset_chip (dev); -- 2.34.1