Emil Tantilov
118082368c
idpf: fix possible vport_config NULL pointer deref in remove
Attempting to remove the driver will cause a crash in cases where
the vport failed to initialize. Following trace is from an instance where
the driver failed during an attempt to create a VF:
[ 1661.543624] idpf 0000:84:00.7: Device HW Reset initiated
[ 1722.923726] idpf 0000:84:00.7: Transaction timed-out (op:1 cookie:2900 vc_op:1 salt:29 timeout:60000ms)
[ 1723.353263] BUG: kernel NULL pointer dereference, address: 0000000000000028
...
[ 1723.358472] RIP: 0010:idpf_remove+0x11c/0x200 [idpf]
...
[ 1723.364973] Call Trace:
[ 1723.365475] <TASK>
[ 1723.365972] pci_device_remove+0x42/0xb0
[ 1723.366481] device_release_driver_internal+0x1a9/0x210
[ 1723.366987] pci_stop_bus_device+0x6d/0x90
[ 1723.367488] pci_stop_and_remove_bus_device+0x12/0x20
[ 1723.367971] pci_iov_remove_virtfn+0xbd/0x120
[ 1723.368309] sriov_disable+0x34/0xe0
[ 1723.368643] idpf_sriov_configure+0x58/0x140 [idpf]
[ 1723.368982] sriov_numvfs_store+0xda/0x1c0
Avoid the NULL pointer dereference by adding NULL pointer check for
vport_config[i], before freeing user_config.q_coalesce.
Fixes: e1e3fec3e3 ("idpf: preserve coalescing settings across resets")
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Reviewed-by: Chittim Madhu <madhu.chittim@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-11-18 13:22:11 -08:00
..
2025-10-14 08:56:31 -06:00
2025-11-06 22:10:27 +01:00
2025-10-22 08:04:15 +02:00
2025-10-13 09:12:36 +02:00
2025-11-01 10:45:39 -07:00
2025-10-20 13:54:15 +02:00
2025-10-31 12:57:19 -07:00
2025-11-11 09:06:57 -05:00
2025-10-04 16:26:32 -07:00
2025-10-04 16:26:32 -07:00
2025-10-18 14:33:22 +03:00
2025-10-07 09:28:37 -07:00
2025-10-07 08:40:15 -07:00
2025-10-22 08:03:52 +02:00
2025-10-15 08:21:16 -05:00
2025-11-06 15:44:18 -08:00
2025-10-23 12:53:23 +08:00
2025-10-14 14:48:14 -07:00
2025-09-15 16:09:42 +02:00
2025-10-15 10:39:54 -04:00
2025-09-26 15:10:59 -07:00
2025-10-06 10:37:06 -07:00
2025-10-24 16:56:37 +01:00
2025-10-28 18:54:48 -07:00
2025-10-13 17:14:47 +02:00
2025-10-25 08:29:56 +09:00
2025-10-23 22:30:01 +02:00
2025-09-22 10:33:10 -03:00
2025-11-06 18:19:44 +01:00
2025-11-09 09:22:08 -08:00
2025-10-18 08:18:18 -10:00
2025-10-01 00:00:45 +00:00
2025-10-19 18:56:14 -07:00
2025-10-04 16:26:32 -07:00
2025-11-03 18:04:15 +01:00
2025-09-29 00:17:22 +02:00
2025-09-23 14:15:25 +02:00
2025-11-11 15:12:18 +01:00
2025-10-08 09:44:38 -07:00
2025-09-12 13:54:17 +03:00
2025-11-05 15:11:26 -04:00
2025-10-07 10:23:22 +02:00
2025-10-31 17:39:14 -07:00
2025-09-16 16:49:28 +01:00
2025-10-08 11:44:21 -07:00
2025-10-03 18:48:02 -07:00
2025-10-24 11:16:26 +02:00
2025-10-02 18:18:33 -07:00
2025-10-03 10:38:23 -05:00
2025-10-26 10:33:46 -07:00
2025-10-13 13:18:03 +02:00
2025-10-22 08:04:43 +02:00
2025-10-04 15:50:37 -07:00
2025-11-18 13:22:11 -08:00
2025-09-22 09:35:21 -04:00
2025-10-06 11:17:18 -07:00
2025-10-22 19:46:25 -07:00
2025-10-22 08:02:38 +02:00
2025-10-24 07:44:09 -05:00
2025-10-31 14:24:32 -07:00
2025-10-07 08:59:25 -07:00
2025-10-06 10:34:22 -07:00
2025-10-06 10:41:03 -07:00
2025-11-05 11:08:10 -08:00
2025-10-01 17:32:51 -07:00
2025-10-01 13:02:59 -07:00
2025-10-31 16:27:40 -07:00
2025-10-01 11:34:12 -07:00
2025-09-15 16:20:29 +02:00
2025-10-30 11:30:23 +00:00
2025-10-04 15:45:17 -07:00
2025-10-01 17:32:51 -07:00
2025-09-20 21:29:48 -05:00
2025-11-08 20:56:12 +01:00
2025-11-17 16:58:25 -08:00
2025-10-21 21:09:36 -04:00
2025-09-12 15:47:38 +02:00
2025-11-04 19:15:36 -08:00
2025-10-06 10:32:22 -07:00
2025-10-29 12:53:45 +00:00
2025-10-13 10:55:03 +02:00
2025-10-11 11:49:00 -07:00
2025-10-17 15:26:52 +02:00
2025-10-02 10:41:58 +02:00
2025-09-23 17:16:38 +02:00
2025-10-22 12:13:54 +02:00
2025-10-29 23:20:19 -04:00
2025-10-07 08:40:15 -07:00
2025-10-24 13:52:58 +02:00
2025-11-11 15:12:18 +01:00
2025-10-28 15:54:41 -06:00
2025-10-01 07:24:43 -04:00
2025-10-28 22:59:19 +01:00
2025-09-29 18:48:39 -07:00
2025-10-04 08:48:16 -07:00
2025-10-06 11:00:30 -07:00
2025-10-03 17:41:12 -07:00
2025-09-15 14:30:17 +02:00
2025-10-07 08:40:15 -07:00