]> git.openfabrics.org - ~emulex/infiniband.git/commit
ata: sata_mv: Cleanup only the initialized ports
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Sun, 16 Feb 2014 15:29:53 +0000 (12:29 -0300)
committerTejun Heo <tj@kernel.org>
Sun, 16 Feb 2014 16:51:17 +0000 (11:51 -0500)
commit8ad116e649b21a42e3cccfb3c1b8d5ea52ba19e5
treec5a69d0a235864821b6ad4d46c9a280b72f95e7f
parent9f9c47f00ce99329b1a82e2ac4f70f0fe3db549c
ata: sata_mv: Cleanup only the initialized ports

When an error occurs in the port initialization loop, currently the
driver tries to cleanup all the ports. This results in a NULL pointer
dereference if the ports were only partially initialized.

Fix this by updating only the number of initialized ports (either
with failure or successfully), before jumping to the error path
and looping over that number in the cleanup loop.

Cc: Andrew Lunn <andrew@lunn.ch>
Reported-by: Mikael Pettersson <mikpelinux@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
drivers/ata/sata_mv.c