Jesper Juhl
c83f1d7e71
ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error
...
In wm2000_i2c_probe(), if we take the true branch in
"
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000,
NULL, 0);
if (ret != 0)
goto err_fw;
"
then we'll release_firmware(fw) at the 'err_fw' label. But we've already
done that just a few lines above. That's a use-after-free bug.
This patch restructures the code so that we always call
release_firmware(fw) before leaving the function, but only ever call
it once.
This means that we have to initialize 'fw' to NULL since some paths
may now end up calling it without having called request_firmware(),
but since request_firmware() deals gracefully with NULL pointers, we
are fine if we just NULL initialize it.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-24 11:34:19 +00:00
..
2011-12-27 12:58:02 +00:00
2010-08-18 18:03:09 +01:00
2011-12-02 10:32:03 +00:00
2011-12-28 17:22:40 +00:00
2011-11-28 18:57:52 +00:00
2011-12-28 17:22:40 +00:00
2011-11-22 13:06:14 +00:00
2011-11-28 11:33:29 +00:00
2010-08-15 14:56:40 +01:00
2011-11-28 11:33:29 +00:00
2010-08-12 14:00:00 +01:00
2011-12-28 17:22:40 +00:00
2011-08-17 00:53:54 +09:00
2011-12-28 17:22:40 +00:00
2011-06-16 11:24:17 +01:00
2011-12-02 10:32:03 +00:00
2011-06-28 17:11:20 +01:00
2011-11-28 11:33:29 +00:00
2011-12-20 10:13:57 +00:00
2011-12-20 10:13:58 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 13:08:33 +00:00
2011-05-19 14:10:45 -07:00
2011-12-20 10:13:58 +00:00
2011-12-20 10:13:58 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 12:28:13 +00:00
2010-10-21 13:51:13 -07:00
2011-12-13 14:27:19 +08:00
2011-11-16 10:41:56 +00:00
2011-11-28 11:33:29 +00:00
2012-01-02 12:28:11 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2011-11-22 13:02:09 +00:00
2012-01-02 12:28:13 +00:00
2011-12-02 10:32:03 +00:00
2012-01-09 11:20:16 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 12:27:29 +00:00
2011-11-28 11:33:29 +00:00
2011-11-28 11:33:29 +00:00
2011-12-28 17:22:41 +00:00
2011-12-06 11:01:38 +00:00
2008-11-17 11:45:39 +00:00
2011-12-27 12:58:02 +00:00
2011-12-13 00:20:11 +08:00
2012-01-02 12:28:11 +00:00
2011-03-11 12:01:44 +00:00
2011-11-22 13:06:21 +00:00
2009-07-15 16:59:31 +01:00
2012-01-02 12:28:11 +00:00
2011-05-15 21:26:36 -07:00
2012-01-02 12:28:11 +00:00
2011-04-20 13:50:41 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 12:28:12 +00:00
2011-09-21 15:52:23 +01:00
2012-01-20 13:54:32 +00:00
2011-10-19 13:08:18 +01:00
2011-11-29 12:01:23 +00:00
2011-11-29 12:01:23 +00:00
2011-11-28 11:33:29 +00:00
2011-02-09 22:32:53 +00:00
2011-11-28 11:33:29 +00:00
2012-01-02 12:28:12 +00:00
2011-09-27 13:30:48 +01:00
2012-01-03 21:18:32 +00:00
2011-11-14 21:32:12 +00:00
2011-12-05 13:30:39 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 12:28:12 +00:00
2010-08-28 10:57:58 +01:00
2012-01-02 12:28:12 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 12:28:12 +00:00
2011-03-31 11:26:23 -03:00
2012-01-20 13:54:33 +00:00
2011-03-04 18:21:08 +00:00
2012-01-02 12:28:13 +00:00
2011-05-11 16:12:35 +01:00
2012-01-02 12:28:13 +00:00
2011-05-11 16:12:45 +01:00
2011-12-02 10:32:03 +00:00
2012-01-11 12:43:24 +00:00
2012-01-11 12:43:24 +00:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-27 12:58:02 +00:00
2010-08-12 14:00:00 +01:00
2011-11-28 11:33:29 +00:00
2011-01-14 12:29:40 +00:00
2011-11-27 16:03:59 +00:00
2012-01-24 11:34:19 +00:00
2011-12-03 21:35:21 +00:00
2011-11-21 18:11:43 +00:00
2012-01-20 13:54:33 +00:00
2011-11-08 14:13:50 +00:00
2011-12-03 21:35:10 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:11 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:12 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 13:08:40 +00:00
2010-08-15 14:52:12 +01:00
2011-12-03 21:35:17 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:01 +00:00
2011-12-03 21:35:18 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-18 16:52:56 +01:00
2011-12-02 10:32:03 +00:00
2010-11-24 11:33:12 +00:00
2011-12-03 21:35:14 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:16 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-09 20:36:59 +08:00
2010-11-06 11:35:39 -04:00
2011-12-23 18:08:02 +00:00
2010-08-12 14:00:00 +01:00
2011-11-28 11:33:29 +00:00
2011-12-09 20:28:17 +08:00
2010-09-30 13:32:21 -07:00
2011-12-09 20:28:18 +08:00
2010-08-12 14:00:00 +01:00
2012-01-02 13:08:39 +00:00
2011-02-22 10:38:13 -08:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2012-01-23 21:10:22 +00:00
2011-12-17 09:39:41 +00:00
2010-08-12 14:00:00 +01:00
2011-12-17 09:39:44 +00:00
2010-08-12 14:00:00 +01:00
2012-01-02 13:08:34 +00:00
2010-10-11 03:52:04 -07:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2011-07-15 23:39:53 +09:00
2011-12-02 10:32:03 +00:00
2010-09-15 16:11:24 +01:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-03 21:35:01 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2011-01-17 13:50:20 +00:00
2012-01-17 16:48:27 +00:00
2010-08-12 14:00:00 +01:00
2011-12-30 01:59:39 +00:00
2011-12-13 00:20:11 +08:00
2011-12-14 13:48:12 +08:00
2010-12-24 11:32:45 +00:00
2012-01-22 16:14:06 +00:00
2012-01-20 13:54:34 +00:00
2011-12-14 17:06:29 +08:00
2010-08-12 14:00:00 +01:00
2011-12-14 17:07:39 +08:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 10:32:03 +00:00
2010-08-12 14:00:00 +01:00
2011-12-02 17:37:49 +00:00
2011-08-01 22:14:49 +09:00