]> git.baikalelectronics.ru Git - kernel.git/commit
ata: sata_mv: check for errors when parsing nr-ports from dt
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 29 Nov 2016 11:13:38 +0000 (12:13 +0100)
committerTejun Heo <tj@kernel.org>
Tue, 29 Nov 2016 16:35:06 +0000 (11:35 -0500)
commit4c5409843cc6b1b7e4b3c4cc2817ff152d970c10
treea29d2bee4b6726435e743819dc4ef4b04f32d652
parent6a3859f31838b594ec53223b794800ccf8cb52f8
ata: sata_mv: check for errors when parsing nr-ports from dt

If the nr-ports property is missing ata_host_alloc_pinfo is called with
n_ports = 0. This results in host->ports[0] = NULL which later makes
mv_init_host() oops when dereferencing this pointer.

Instead be a bit more cooperative and fail the probing with an error
message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/sata_mv.c