From: Johan Hovold Date: Mon, 12 Jan 2015 16:12:25 +0000 (+0100) Subject: gpio: fix gpio-chip list corruption X-Git-Tag: fixes-v4.0-rc1~273^2~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=225fce83cb72e1bffb712a33ce47c210c770f8ab;p=pandora-kernel.git gpio: fix gpio-chip list corruption Fix potential corruption of gpio-chip list due to failure to remove the chip from the list before returning in gpiochip_add error path. The chip could be long gone when the global list is next traversed, something which could lead to a null-pointer dereference. In the best case (chip not deallocated) we are just leaking the gpio range. Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array") Signed-off-by: Johan Hovold Signed-off-by: Linus Walleij --- Reading git-diff-tree failed