Skip to contentSkip to conversation

memory: ti-aemif: fix a potential NULL-pointer dereference

PATCH Applied Bartosz Golaszewski 3 participants 4 messages Sep 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: ti-aemif: fix a potential NULL-pointer dereference

From: Bartosz Golaszewski <[email protected]>

Platform data pointer may be NULL. We check it everywhere but in one place. Fix it.

Fixes 8af70cd2ca50 ("memory: aemif: add support for board files")
---
 drivers/memory/ti-aemif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/ti-aemif.c +1 -1
index 31112f622b88..475e5b3790ed 100644
@@ -411,7 +411,7 @@ static int aemif_probe(struct platform_device *pdev)
 			if (ret < 0)
 				goto error;
 		}
-	} else {
+	} else if (pdata) {
 		for (i = 0; i < pdata->num_sub_devices; i++) {
 			pdata->sub_devices[i].dev.parent = dev;
 			ret = platform_device_register(&pdata->sub_devices[i]);
Signature · 1 line
2.18.0
#1 lore raw

Hi Arnd, Olof,

Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Platform data pointer may be NULL. We check it everywhere but in one place. Fix it.

Quoted 8 lines
Fixes 8af70cd2ca50 ("memory: aemif: add support for board files")
---
  drivers/memory/ti-aemif.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Will you be able to push this via drivers-soc fixes ?

Regards,
Santosh

#2 lore raw
Quoted 16 lines · Santosh Shilimkar

Hi Arnd, Olof,

Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Platform data pointer may be NULL. We check it everywhere but in one place. Fix it.

Quoted 8 lines
Fixes 8af70cd2ca50 ("memory: aemif: add support for board files")
---
  drivers/memory/ti-aemif.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line

Will you be able to push this via drivers-soc fixes ?

Applied to fixes.

-Olof

#3 lore raw
Quoted 17 lines · Olof Johansson
Quoted 16 lines · Santosh Shilimkar

Hi Arnd, Olof,

Quoted 13 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Platform data pointer may be NULL. We check it everywhere but in one place. Fix it.

Fixes 8af70cd2ca50 ("memory: aemif: add support for board files")
---
   drivers/memory/ti-aemif.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

Will you be able to push this via drivers-soc fixes ?

Applied to fixes.

Thanks Olof !!

Regards,
Santosh