Jason Yan
650c8ec81f
scsi: megaraid_sas: return error when create DMA pool failed
[ Upstream commit bcf3b67d16 ]
when create DMA pool for cmd frames failed, we should return -ENOMEM,
instead of 0.
In some case in:
megasas_init_adapter_fusion()
-->megasas_alloc_cmds()
-->megasas_create_frame_pool
create DMA pool failed,
--> megasas_free_cmds() [1]
-->megasas_alloc_cmds_fusion()
failed, then goto fail_alloc_cmds.
-->megasas_free_cmds() [2]
we will call megasas_free_cmds twice, [1] will kfree cmd_list,
[2] will use cmd_list.it will cause a problem:
Unable to handle kernel NULL pointer dereference at virtual address
00000000
pgd = ffffffc000f70000
[00000000] *pgd=0000001fbf893003, *pud=0000001fbf893003,
*pmd=0000001fbf894003, *pte=006000006d000707
Internal error: Oops: 96000005 [#1] SMP
Modules linked in:
CPU: 18 PID: 1 Comm: swapper/0 Not tainted
task: ffffffdfb9290000 ti: ffffffdfb923c000 task.ti: ffffffdfb923c000
PC is at megasas_free_cmds+0x30/0x70
LR is at megasas_free_cmds+0x24/0x70
...
Call trace:
[<ffffffc0005b779c>] megasas_free_cmds+0x30/0x70
[<ffffffc0005bca74>] megasas_init_adapter_fusion+0x2f4/0x4d8
[<ffffffc0005b926c>] megasas_init_fw+0x2dc/0x760
[<ffffffc0005b9ab0>] megasas_probe_one+0x3c0/0xcd8
[<ffffffc0004a5abc>] local_pci_probe+0x4c/0xb4
[<ffffffc0004a5c40>] pci_device_probe+0x11c/0x14c
[<ffffffc00053a5e4>] driver_probe_device+0x1ec/0x430
[<ffffffc00053a92c>] __driver_attach+0xa8/0xb0
[<ffffffc000538178>] bus_for_each_dev+0x74/0xc8
[<ffffffc000539e88>] driver_attach+0x28/0x34
[<ffffffc000539a18>] bus_add_driver+0x16c/0x248
[<ffffffc00053b234>] driver_register+0x6c/0x138
[<ffffffc0004a5350>] __pci_register_driver+0x5c/0x6c
[<ffffffc000ce3868>] megasas_init+0xc0/0x1a8
[<ffffffc000082a58>] do_one_initcall+0xe8/0x1ec
[<ffffffc000ca7be8>] kernel_init_freeable+0x1c8/0x284
[<ffffffc0008d90b8>] kernel_init+0x1c/0xe4
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:29:10 +02:00
..
2019-03-13 14:05:01 -07:00
2016-02-23 21:27:02 -05:00
2019-02-20 10:18:35 +01:00
2016-10-26 22:17:43 -04:00
2018-05-25 16:13:06 +02:00
2018-03-22 09:17:43 +01:00
2018-12-08 13:05:05 +01:00
2019-01-13 10:03:48 +01:00
2018-10-03 17:01:48 -07:00
2019-03-05 17:57:05 +01:00
2017-12-25 14:23:44 +01:00
2016-09-14 12:47:42 -04:00
2017-10-21 17:21:36 +02:00
2016-08-25 22:28:17 -04:00
2018-09-05 09:20:04 +02:00
2018-03-22 09:17:41 +01:00
2019-04-05 22:29:06 +02:00
2018-10-03 17:01:45 -07:00
2018-10-20 09:51:30 +02:00
2019-02-27 10:06:59 +01:00
2019-03-13 14:04:57 -07:00
2019-03-05 17:57:03 +01:00
2019-02-12 19:44:51 +01:00
2019-04-05 22:29:10 +02:00
2018-05-25 16:13:07 +02:00
2018-05-25 16:13:08 +02:00
2016-07-20 17:38:35 -06:00
2015-05-31 18:06:28 -07:00
2016-09-26 21:10:45 -04:00
2018-11-21 09:25:57 +01:00
2019-02-27 10:06:59 +01:00
2019-02-12 19:44:56 +01:00
2017-08-06 18:59:49 -07:00
2018-05-25 16:13:06 +02:00
2019-03-27 14:13:04 +09:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:10:19 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:04:39 -07:00
2018-09-19 22:47:14 +02:00
2015-04-27 10:05:55 -07:00
2016-07-13 22:33:23 -04:00
2016-07-13 22:33:23 -04:00
2015-08-07 15:03:42 +02:00
2013-11-26 11:09:07 +01:00
2014-10-20 16:21:33 +02:00
2014-10-20 16:21:33 +02:00
2018-02-25 11:05:53 +01:00
2015-05-31 18:06:28 -07:00
2016-02-23 21:27:02 -05:00
2015-04-09 18:08:31 -07:00
2015-05-31 18:06:28 -07:00
2015-05-31 18:06:28 -07:00
2015-04-17 10:13:56 -07:00
2016-04-11 16:57:09 -04:00
2015-11-25 22:08:55 -05:00
2015-11-25 22:08:52 -05:00
2015-02-02 09:57:45 -08:00
2013-06-26 18:32:47 -07:00
2014-10-20 16:21:33 +02:00
2015-04-14 09:50:27 -07:00
2016-08-16 00:49:32 -04:00
2015-02-02 09:57:46 -08:00
2016-04-11 16:57:09 -04:00
2016-02-23 21:27:02 -05:00
2014-07-17 22:07:37 +02:00
2016-05-10 22:01:07 -04:00
2014-11-24 14:45:27 +01:00
2018-11-13 11:16:51 -08:00
2018-11-13 11:16:51 -08:00
2016-02-23 21:27:02 -05:00
2015-11-09 16:32:14 -08:00
2017-01-12 11:39:29 +01:00
2016-09-29 21:52:43 -04:00
2016-02-25 21:16:49 -05:00
2013-04-09 14:13:16 -04:00
2016-02-25 21:16:49 -05:00
2013-04-09 14:13:16 -04:00
2013-11-26 11:09:07 +01:00
2016-10-07 09:28:53 -07:00
2017-12-20 10:07:22 +01:00
2018-01-23 19:57:05 +01:00
2017-12-20 10:07:22 +01:00
2015-08-12 13:14:57 -07:00
2015-08-12 13:14:57 -07:00
2016-02-25 21:10:53 -05:00
2015-11-20 11:39:03 -05:00
2018-03-22 09:17:42 +01:00
2016-09-19 11:57:33 -04:00
2015-06-02 17:24:54 -07:00
2013-04-09 14:13:27 -04:00
2016-05-16 11:14:29 -04:00
2016-05-19 11:36:49 -07:00
2016-01-27 20:36:10 +08:00
2014-10-20 16:21:33 +02:00
2017-05-14 14:00:19 +02:00
2013-01-03 15:57:01 -08:00
2016-01-27 20:36:10 +08:00
2019-03-23 13:19:42 +01:00
2016-02-05 16:29:28 -06:00
2018-11-13 11:16:51 -08:00
2016-04-11 16:57:09 -04:00
2016-09-26 20:49:25 -04:00
2018-08-03 07:55:23 +02:00
2014-03-27 08:26:31 -07:00
2016-02-05 16:29:28 -06:00
2014-10-20 16:21:33 +02:00
2013-04-09 14:13:15 -04:00
2016-03-05 17:07:46 -05:00
2013-04-15 14:30:44 -06:00
2014-11-24 14:45:27 +01:00
2014-07-17 22:07:35 +02:00
2015-05-31 18:06:28 -07:00
2016-10-17 14:13:03 -04:00
2016-09-14 14:11:12 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2015-05-31 18:06:28 -07:00
2014-11-24 20:01:28 +01:00
2016-09-04 01:28:07 -04:00
2012-02-21 11:40:37 +01:00
2016-02-23 21:27:02 -05:00
2015-05-31 18:06:28 -07:00
2016-04-30 09:25:26 -07:00
2015-05-31 18:06:28 -07:00
2016-03-01 20:06:49 -05:00
2016-11-28 15:51:31 -05:00
2016-04-04 12:07:42 -04:00
2017-12-20 10:07:30 +01:00
2018-12-08 13:05:06 +01:00
2018-08-03 07:55:25 +02:00
2016-06-18 11:59:01 -07:00
2014-11-12 11:16:12 +01:00
2017-12-14 09:28:11 +01:00
2015-02-04 08:00:24 -08:00
2014-11-12 11:16:05 +01:00
2014-04-24 13:44:54 -04:00
2019-01-23 08:10:54 +01:00
2016-10-07 09:28:53 -07:00
2016-04-11 16:57:09 -04:00
2016-03-14 21:05:04 -04:00
2019-04-05 22:29:08 +02:00
2014-06-06 16:08:16 -07:00
2018-09-05 09:20:10 +02:00
2016-04-11 16:57:09 -04:00
2016-04-11 16:57:09 -04:00
2017-10-05 09:43:59 +02:00
2016-08-18 22:23:20 -04:00
2015-08-07 14:28:45 +02:00
2018-06-06 16:44:38 +02:00
2016-09-26 20:58:42 -04:00
2014-11-12 11:15:54 +01:00
2016-09-15 09:51:14 -04:00
2019-04-03 06:24:17 +02:00
2016-09-15 09:51:14 -04:00
2016-04-11 16:57:09 -04:00
2018-03-22 09:17:55 +01:00
2018-08-06 16:23:04 +02:00
2014-10-20 16:21:33 +02:00
2016-02-23 21:27:02 -05:00
2014-10-20 16:21:33 +02:00
2018-12-13 09:20:29 +01:00
2014-07-17 22:07:39 +02:00
2018-08-15 18:14:42 +02:00
2014-11-12 11:15:57 +01:00
2016-10-18 14:13:37 -07:00
2015-11-18 11:59:09 -05:00
2016-02-23 21:27:02 -05:00
2018-05-25 16:13:07 +02:00
2014-05-28 12:16:28 +02:00
2016-04-11 16:57:09 -04:00
2014-11-20 09:11:15 +01:00
2015-08-10 23:07:05 -04:00
2014-10-20 16:21:33 +02:00
2015-05-31 18:06:28 -07:00
2019-03-23 13:19:46 +01:00
2018-12-21 14:11:35 +01:00
2016-11-01 13:31:23 -04:00
2015-02-02 09:57:46 -08:00
2013-04-09 14:13:15 -04:00
2016-09-01 17:52:01 -07:00
2015-05-31 18:06:28 -07:00
2018-08-24 13:12:29 +02:00
2013-01-03 15:57:01 -08:00
2013-11-26 11:09:07 +01:00