Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1E643B9927; Sat, 17 Oct 2026 17:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792259155; cv=none; b=avHQRIltcNhq1TxWkz2HjARSLnCRNpkLB60d/secFHD+tnrK546ckEaNvh+ZcJtItazATY9BsvGUBI3NSOI7QhpqFve/JbjdudU+BtO5gf8LzJE64W4JLPs1+E/O7F2Y0agmUYDmY+eJPDi/TH5rnpwRIAoAC3ZgMR18yxd0QZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792259155; c=relaxed/simple; bh=aBw5ymQI6u0IxNEj3u3qEnPY7EcCuj+KWme4gvyocZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AI4zC5m6zyC8bhK/D0FR0QJvN60SwazcjAEfWYXxMultslGgoUNYDVlujpfNY0SuSxSgEV2nQSl+N9GPvHbyXAMVS9QTWn0Y7E8WcS06ScPt9++B6dZyoxym9PMQU9aqPPbOje5gfzJeYYPKjYZ5aTAzb7M2oQposSjoBMHR15o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cGJ/wPZC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cGJ/wPZC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9E081F000C4; Sat, 17 Oct 2026 17:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792259154; bh=JaHaAYcbJi3VFVAdGnawvFyEHwFQrRIg+KGvD0sRK7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cGJ/wPZCO9tIBbk0mKB1rhxPm+NUitgPgc+FVt2L8LqjM+sKJpKpW8ZRppvALBq7Y Mypcqu6rKzi4JSNg0ks2eHfzU42DiBo9xjFgbt61Y8WThvd+j7gc+51M4FrXzJN3vS Cgz6ge7LaZc3K3D+5c9vEP/12lHJFeD4jay6Go+4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fuchs , Miquel Raynal , Sasha Levin Subject: [PATCH 6.6 1121/1674] mtd: maps: vmu-flash: fix fault in unaligned fixup Date: Sat, 17 Oct 2026 17:56:33 +0200 Message-ID: <20261017160459.908880673@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fuchs [ Upstream commit 79d1661502c6e4b6f626185cef72cf2fa78116e1 ] Use kzalloc_obj() / kzalloc_objs() to allocate the memcard structs, instead of kmalloc_obj() / kmalloc_objs() to prevent access to uninitialized data. Fixes runtime error: Fault in unaligned fixup: 0000 [#1] at mtd_get_fact_prot_info. Fixes: 47a72688fae7 ("mtd: flash mapping support for Dreamcast VMU.") Cc: stable@vger.kernel.org Signed-off-by: Florian Fuchs Signed-off-by: Miquel Raynal Signed-off-by: Sasha Levin --- drivers/mtd/maps/vmu-flash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c index 3667faefe6c58..7b439b8167d87 100644 --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c @@ -610,7 +610,7 @@ static int vmu_connect(struct maple_device *mdev) basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); - card = kmalloc(sizeof(struct memcard), GFP_KERNEL); + card = kzalloc(sizeof(struct memcard), GFP_KERNEL); if (!card) { error = -ENOMEM; goto fail_nomem; @@ -628,15 +628,15 @@ static int vmu_connect(struct maple_device *mdev) * Not sure there are actually any multi-partition devices in the * real world, but the hardware supports them, so, so will we */ - card->parts = kmalloc_array(card->partitions, sizeof(struct vmupart), - GFP_KERNEL); + card->parts = kcalloc(card->partitions, sizeof(struct vmupart), + GFP_KERNEL); if (!card->parts) { error = -ENOMEM; goto fail_partitions; } - card->mtd = kmalloc_array(card->partitions, sizeof(struct mtd_info), - GFP_KERNEL); + card->mtd = kcalloc(card->partitions, sizeof(struct mtd_info), + GFP_KERNEL); if (!card->mtd) { error = -ENOMEM; goto fail_mtd_info; -- 2.53.0