blspec: fix crash when trying to boot from loop mounts
When trying to boot from a loop mount path, the blspec code passes a NULL pointer to dev_name, because cdev->dev is not set for loop mounts: unable to handle NULL pointer dereference at address 0x00000020 pc : [<4fe09e28>] lr : [<4fe02305>] sp : 4ffef7c0 ip : 31b75c78 fp : 31b6a388 r10: 31b6a368 r9 : 315a4cac r8 : 00000001 r7 : 00000001 r6 : 311b8540 r5 : ffffffea r4 : 31b6a3f8 r3 : 00000000 r2 : 10000000 r1 : 00000001 r0 : 00000000 Flags: nzcv IRQs off FIQs off Mode SVC_32 [<4fe09e28>] (dev_id+0xc/0x38) from [<4fe02305>] (blspec_scan_directory+0x3e1/0x484) [<4fe02305>] (blspec_scan_directory+0x3e1/0x484) from [<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c) [<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c) from [<4fe0984b>] (bootentry_create_from_name+0x23/0xdc) [<4fe0984b>] (bootentry_create_from_name+0x23/0xdc) from [<4fe246f9>] (do_boot+0x95/0x160) [<4fe246f9>] (do_boot+0x95/0x160) from [<4fe032e9>] (execute_command+0x21/0x48) [<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634) [<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe08249>] (parse_stream_outer+0xd9/0x164) [<4fe08249>] (parse_stream_outer+0xd9/0x164) from [<4fe08b6d>] (run_shell+0x31/0x60) [<4fe08b6d>] (run_shell+0x31/0x60) from [<4fe032e9>] (execute_command+0x21/0x48) [<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634) [<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe085fd>] (run_list_real+0x285/0x634) [<4fe444b9>] (unwind_backtrace+0x1/0x58) from [<4fe00b7d>] (panic+0x1d/0x34) [<4fe00b7d>] (panic+0x1d/0x34) from [<4fe42a75>] (do_exception+0xd/0x10) [<4fe42a75>] (do_exception+0xd/0x10) from [<4fe42ad5>] (do_data_abort+0x21/0x2c) [<4fe42ad5>] (do_data_abort+0x21/0x2c) from [<4fe42394>] (do_abort_6+0x48/0x54) Fix this by checking cdev->dev as well as cdev before calling dev_name. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
WIP_next-LS
master
next
stable/v2018.07
stable/v2018.09
stable/v2018.12
v2020.07.0
v2020.06.0
v2020.05.0
v2020.04.0
v2020.03.0
v2020.02.0
v2020.01.0
v2019.12.0
v2019.11.0
v2019.10.0
v2019.09.0
v2019.08.1
v2019.08.0
v2019.07.0
v2019.06.1
v2019.06.0
v2019.05.0
v2019.04.0
v2019.03.0
v2019.02.0
v2019.01.0
v2018.12.0
v2018.11.0
v2018.10.0
v2018.09.1
v2018.09.0
v2018.08.1
v2018.08.0
v2018.07.2
v2018.07.1
v2018.07.0
v2018.06.0
v2018.05.0
v2018.04.0
v2018.03.0
v2018.02.0
v2018.01.0
|
---|
|
common/blspec.c |
---|