[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251117224408.498449-4-fuchsfl@gmail.com>
Date: Mon, 17 Nov 2025 23:44:08 +0100
From: Florian Fuchs <fuchsfl@...il.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
linux-mtd@...ts.infradead.org
Cc: linux-sh@...r.kernel.org,
linux-kernel@...r.kernel.org,
Rich Felker <dalias@...c.org>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Florian Fuchs <fuchsfl@...il.com>
Subject: [PATCH 3/3] mtd: maps: vmu-flash: Fix NULL pointer dereference in initialization
The mtd_info contains a struct device, which must be linked to its
parent. Without this, the initialization of the MTD fails with a NULL
pointer dereference.
Signed-off-by: Florian Fuchs <fuchsfl@...il.com>
---
drivers/mtd/maps/vmu-flash.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c
index d0793f1b0fac..153ba6f8f769 100644
--- a/drivers/mtd/maps/vmu-flash.c
+++ b/drivers/mtd/maps/vmu-flash.c
@@ -547,6 +547,7 @@ static void vmu_queryblocks(struct mapleq *mq)
mpart->partition = card->partition;
mtd_cur->priv = mpart;
mtd_cur->owner = THIS_MODULE;
+ mtd_cur->dev.parent = &mdev->dev;
pcache = kzalloc(sizeof(struct vmu_cache), GFP_KERNEL);
if (!pcache)
--
2.43.0
Powered by blists - more mailing lists