Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3978282pxb; Tue, 25 Jan 2022 00:30:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5CVoDp3bHeaoWcPOrh8mH6i7/48FSKysmcKnr6SU1HqYp5q53deyQMDVHtN82BCCML81u X-Received: by 2002:a17:906:b058:: with SMTP id bj24mr14780969ejb.447.1643099409351; Tue, 25 Jan 2022 00:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099409; cv=none; d=google.com; s=arc-20160816; b=Hbm+T9s5Bmlcfel9Y2HeYTU8TljINwIHLxtsxOPSC4BfkYg1pWee1GlWR5ufzs+FC8 mw5170xCm13YqscVMKDqvY9XKjVIOMP89XejBQ+ehlpdGXgQRUEgqe/27faIC7ZcQC2x oxFU1Q+25HQGd5YQGRHBVcn8/grHmJUzR4w2W1q3n0mjOS4oJZpOMPus/D82qpmPOnuk v6faDg7yE0GallMnR7f5liqbu3VrNLg8esa8gQrhAZM9VWmDojL0mCtyBNDo+VygmYOr BZ6ZXBXr6gCOMmDVK8Qh36DfhqsY6PuQiO56qXmxfdyEUasjfO9rOQLnLpFMbxtxaGZa xNaw== 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=sZhHyQrAMSg0ZjAAbN8+mqxLVdhm/K79RdBr2A3QtG0=; b=YG07U8uHZ+TskszNvcdYXi4cUye0DnYxKVXJfH2+fh/8Ceqx2Wb//Uq7eukY//rmLX r01zVDjz4nI0JUWgTWEga1a2dudZ4Vs2XfD84qojtA1kVjepozBEbzPrRCoPbeWdebhc cX+tB+jTqDE39nv498k1g5lhESJ805gvNxjJI6aKJB2YTVqO1hL2RQR9n2bcU9zMLPtF Z2aXuaXw9lkXU5embrEZ1ufojrXKjFE35UXuDWDAunBldndXvuJxR1nkkDl8P/xRLYZ0 VjjoG9pAMYMLTm+XO8wSQX4r7Ri/Q/WLrfa0yXVRwOWpaLEkacShQtc96NAl9Yjm+Qhv 0lhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qbkL7rZc; 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 sd33si1086628ejc.440.2022.01.25.00.29.44; Tue, 25 Jan 2022 00:30:09 -0800 (PST) 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=qbkL7rZc; 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 S236514AbiAYChE (ORCPT + 99 others); Mon, 24 Jan 2022 21:37:04 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:56570 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356389AbiAXUbs (ORCPT ); Mon, 24 Jan 2022 15:31:48 -0500 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 dfw.source.kernel.org (Postfix) with ESMTPS id C734F61507; Mon, 24 Jan 2022 20:31:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A88B7C340E7; Mon, 24 Jan 2022 20:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056306; bh=jSECrfroaRL6gnqItNOsQdsp2IFqaB2YwhTsNYAREpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbkL7rZcAadjGGXiERffxLUBraxnHOt+gS5W3FLHh8bW2GzSm0cQiDXQguUIZFGCF ZAUs0937BkD1Uvx+bbpiLg6CqyoMT3QiZeP53zbVroQp6Q84nqkjwCYac3fRQEY0Lf CHYNCQr46COSyH0EzURxWBRq36DGvP/0/ISTaoCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ammar Faizi , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 441/846] powerpc/xive: Add missing null check after calling kmalloc Date: Mon, 24 Jan 2022 19:39:18 +0100 Message-Id: <20220124184116.179143525@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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: Ammar Faizi [ Upstream commit 18dbfcdedc802f9500b2c29794f22a31d27639c0 ] Commit 930914b7d528fc ("powerpc/xive: Add a debugfs file to dump internal XIVE state") forgot to add a null check. Add it. Fixes: 930914b7d528fc6b0249bffc00564100bcf6ef75 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Signed-off-by: Ammar Faizi Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211226135314.251221-1-ammar.faizi@intel.com Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/spapr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index f143b6f111ac0..1179632560b8d 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -653,6 +653,9 @@ static int xive_spapr_debug_show(struct seq_file *m, void *private) struct xive_irq_bitmap *xibm; char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (!buf) + return -ENOMEM; + list_for_each_entry(xibm, &xive_irq_bitmaps, list) { memset(buf, 0, PAGE_SIZE); bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count); -- 2.34.1