Commit 660b412
authored
HSD# 16027100077-3: mtd: spi-nor: core: Check for null pointer to avoid soft error
Ensure that the pointer passed to module_put() in spi_nor_put_device()
is not NULL before use. In certain configurations, the pointer may be
uninitialized or NULL, which can lead to a null pointer dereference
and a soft kernel error.
This change adds a guard clause to return early, preventing the error
and maintaining system stability without requiring a reboot.
Signed-off-by: Khairul Anuar Romli <[email protected]>1 parent 9804ccc commit 660b412
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3250 | 3250 | | |
3251 | 3251 | | |
3252 | 3252 | | |
3253 | | - | |
| 3253 | + | |
| 3254 | + | |
3254 | 3255 | | |
3255 | 3256 | | |
3256 | 3257 | | |
| |||
0 commit comments