From: Luis R. Rodriguez Date: Tue, 9 Nov 2010 00:53:11 +0000 (-0800) Subject: compat: backport upstream firmware_class bug through f45f3c1f X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=af9fe6fe19c34f57a1f353bd8c2e4d8447edb51e;p=openwrt%2Fstaging%2Fblogic.git compat: backport upstream firmware_class bug through f45f3c1f This backports this patch: commit f45f3c1f3f616ca1d1e1eb5e7a720ca63cb59550 Author: Johannes Berg Date: Wed Aug 18 17:15:18 2010 +0200 firmware_class: fix typo in error path In the error path, _request_firmware sets firmware_p to NULL rather than *firmware_p, which leads to passing a freed firmware struct to drivers when the firmware file cannot be found. Fix this. Broken by commit f8a4bd3456b988fc73b2c. Reported-by: Wey-Yi Guy Signed-off-by: Johannes Berg Acked-by: Dmitry Torokhov Signed-off-by: Pekka Enberg Signed-off-by: Greg Kroah-Hartman All kernels older than 2.6.33 would be affected by this. Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat_firmware_class.c b/compat/compat_firmware_class.c index 70ab25cda0c4..79cd543e1e51 100644 --- a/compat/compat_firmware_class.c +++ b/compat/compat_firmware_class.c @@ -601,7 +601,7 @@ static int _request_firmware(const struct firmware **firmware_p, out: if (retval) { release_firmware(firmware); - firmware_p = NULL; + *firmware_p = NULL; } return retval;