From: Ezequiel Garcia Date: Sun, 16 Feb 2014 15:29:53 +0000 (-0300) Subject: ata: sata_mv: Cleanup only the initialized ports X-Git-Tag: v3.14-rc4~21^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad116e649b21a42e3cccfb3c1b8d5ea52ba19e5;p=pandora-kernel.git 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 Reported-by: Mikael Pettersson Signed-off-by: Ezequiel Garcia Signed-off-by: Tejun Heo Cc: stable@vger.kernel.org --- Reading git-diff-tree failed