[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250306081710.247247-1-manjunatha.venkatesh@nxp.com>
Date: Thu, 6 Mar 2025 13:47:10 +0530
From: Manjunatha Venkatesh <manjunatha.venkatesh@....com>
To: miquel.raynal@...tlin.com,
conor.culhane@...vaco.com,
alexandre.belloni@...tlin.com,
linux-i3c@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org,
manjunatha.venkatesh@....com,
rvmanjumce@...il.com
Subject: [PATCH v2] svc-i3c-master: Fix read from unreadable memory at svc_i3c_master_ibi_work()
As part of I3C driver probing sequence for particular device instance,
While adding to queue it is trying to access ibi variable of dev which is
not yet initialized causing "Unable to handle kernel read from unreadable
memory" resulting in kernel panic.
Signed-off-by: Manjunatha Venkatesh <manjunatha.venkatesh@....com>
---
Changes since v1:
- Patch tittle updated as per the review feedback
drivers/i3c/master/svc-i3c-master.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index d6057d8c7dec..98c4d2e5cd8d 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -534,8 +534,11 @@ static void svc_i3c_master_ibi_work(struct work_struct *work)
switch (ibitype) {
case SVC_I3C_MSTATUS_IBITYPE_IBI:
if (dev) {
- i3c_master_queue_ibi(dev, master->ibi.tbq_slot);
- master->ibi.tbq_slot = NULL;
+ data = i3c_dev_get_master_data(dev);
+ if (master->ibi.slots[data->ibi]) {
+ i3c_master_queue_ibi(dev, master->ibi.tbq_slot);
+ master->ibi.tbq_slot = NULL;
+ }
}
svc_i3c_master_emit_stop(master);
break;
--
2.46.1
Powered by blists - more mailing lists