From: Geert Uytterhoeven Date: Tue, 29 Oct 2013 14:47:22 +0000 (+0100) Subject: mfd: Fix memory leak in mfd_add_devices() X-Git-Tag: v3.13-rc1~66^2^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b208e41acf34c133a55a57189af30aa7924e0c6;p=pandora-kernel.git mfd: Fix memory leak in mfd_add_devices() If the first call to mfd_add_device() fails, no child devices have been registered to the parent yet, and thus mfd_remove_devices() won't find anything to remove nor free. Hence the previously allocated array of atomic_t objects will leak. Free the array instead of calling mfd_remove_devices() on failure during the first loop iteration to fix this. Signed-off-by: Geert Uytterhoeven Signed-off-by: Lee Jones --- Reading git-diff-tree failed