linux-stable/drivers
Yuan Can fc998d0a7d scsi: hpsa: Fix possible memory leak in hpsa_init_one()
[ Upstream commit 9c9ff300e0 ]

The hpda_alloc_ctlr_info() allocates h and its field reply_map. However, in
hpsa_init_one(), if alloc_percpu() failed, the hpsa_init_one() jumps to
clean1 directly, which frees h and leaks the h->reply_map.

Fix by calling hpda_free_ctlr_info() to release h->replay_map and h instead
free h directly.

Fixes: 8b834bff1b ("scsi: hpsa: fix selection of reply queue")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221122015751.87284-1-yuancan@huawei.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:26:20 +01:00
..
accessibility speakup: replace utils' u_char with unsigned char 2022-11-26 09:27:45 +01:00
acpi ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage() 2022-12-31 13:25:46 +01:00
amba
android binder: validate alloc->mm in ->mmap() handler 2022-12-02 17:42:59 +01:00
ata ata: libata: fix NCQ autosense logic 2022-12-31 13:25:50 +01:00
atm
auxdisplay
base regmap-irq: Use the new num_config_regs property in regmap_add_irq_chip_fwnode 2022-12-31 13:25:56 +01:00
bcma
block drbd: destroy workqueue when drbd device was freed 2022-12-31 13:26:02 +01:00
bluetooth Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave() 2022-12-31 13:26:15 +01:00
bus bus: ixp4xx: Don't touch bit 7 on IXP42x 2022-12-02 17:43:11 +01:00
cdrom
char ipmi: kcs: Poll OBF briefly to reduce OBE latency 2022-12-31 13:25:50 +01:00
clk clk: socfpga: Fix memory leak in socfpga_gate_init() 2022-12-31 13:26:12 +01:00
clocksource clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock() 2022-12-31 13:25:46 +01:00
comedi
connector
counter counter: 104-quad-8: Fix race getting function mode and direction 2022-11-04 00:00:23 +09:00
cpufreq cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() 2022-12-31 13:25:45 +01:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2022-12-31 13:25:42 +01:00
crypto crypto: ccree - Make cc_debugfs_global_fini() available for module init function 2022-12-31 13:26:19 +01:00
cxl cxl/pmem: Use size_add() against integer overflow 2022-11-26 09:27:21 +01:00
dax devdax: Fix soft-reservation memory description 2022-09-24 18:05:53 -07:00
dca
devfreq
dio
dma dmaengine: at_hdmac: Check return code of dma_async_device_register 2022-11-16 10:04:14 +01:00
dma-buf dma-buf: Use dma_fence_unwrap_for_each when importing fences 2022-12-02 17:43:10 +01:00
edac EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper() 2022-12-31 13:25:44 +01:00
eisa
extcon
firewire
firmware firmware: ti_sci: Fix polled mode during system suspend 2022-12-31 13:25:36 +01:00
fpga fpga: m10bmc-sec: Fix kconfig dependencies 2022-12-02 17:43:12 +01:00
fsi fsi: master-ast-cf: Fix missing of_node_put in fsi_master_acf_probe 2022-10-21 12:39:26 +02:00
gnss
gpio gpio/rockchip: fix refcount leak in rockchip_gpiolib_register() 2022-12-14 11:41:02 +01:00
gpu drm/i915/bios: fix a memory leak in generate_lfp_data_ptrs 2022-12-31 13:26:05 +01:00
greybus
hid HID: hid-sensor-custom: set fixed size for custom attributes 2022-12-31 13:26:00 +01:00
hsi HSI: ssi_protocol: fix potential resource leak in ssip_pn_open() 2022-10-21 12:39:23 +02:00
hte
hv Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:43:06 +01:00
hwmon hwmon: (jc42) Restore the min/max/critical temperatures on resume 2022-12-31 13:26:08 +01:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 10:03:50 +01:00
hwtracing coresight: cti: Fix hang in cti_disable_hw() 2022-11-04 00:00:22 +09:00
i2c i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set 2022-12-08 11:30:21 +01:00
i3c
idle
iio iio: light: rpr0521: add missing Kconfig dependencies 2022-12-08 11:30:14 +01:00
infiniband RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed 2022-12-31 13:26:20 +01:00
input Input: wistron_btns - disable on UML 2022-12-31 13:26:06 +01:00
interconnect
iommu iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-08 11:30:21 +01:00
ipack
irqchip irqchip/loongson-liointc: Fix improper error handling in liointc_init() 2022-12-31 13:25:44 +01:00
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-26 09:27:35 +01:00
leds leds: lm3601x: Don't use mutex after it was destroyed 2022-10-21 12:38:02 +02:00
macintosh
mailbox mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure 2022-12-31 13:25:43 +01:00
mcb
md dm: track per-add_disk holder relations in DM 2022-12-31 13:25:59 +01:00
media media: coda: Add check for kmalloc 2022-12-31 13:26:11 +01:00
memory memory: renesas-rpc-if: Clear HS bit during hardware initialization 2022-12-31 13:25:36 +01:00
memstick memstick/ms_block: Add check for alloc_ordered_workqueue 2022-12-31 13:26:11 +01:00
message
mfd mfd: da9061: Fix Failed to set Two-Wire Bus Mode. 2022-10-21 12:38:52 +02:00
misc misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-26 09:27:51 +01:00
mmc mmc: core: Normalize the error handling branch in sd_read_ext_regs() 2022-12-31 13:26:11 +01:00
most
mtd mtd: maps: pxa2xx-flash: fix memory leak in probe 2022-12-31 13:26:02 +01:00
mux
net i40e: Fix the inability to attach XDP program on downed interface 2022-12-31 13:26:15 +01:00
nfc nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION 2022-12-02 17:43:09 +01:00
ntb
nubus
nvdimm Merge branch 'for-6.0/dax' into libnvdimm-fixes 2022-09-24 18:14:12 -07:00
nvme nvme: return err on nvme_init_non_mdts_limits fail 2022-12-31 13:25:58 +01:00
nvmem nvmem: rmem: Fix return value check in rmem_read() 2022-12-08 11:30:15 +01:00
of of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop() 2022-12-31 13:26:12 +01:00
opp
parisc parisc: Export iosapic_serial_irq() symbol for serial port driver 2022-11-10 18:17:35 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:27:30 +01:00
pci PCI: endpoint: pci-epf-vntb: Fix call pci_epc_mem_free_addr() in error path 2022-12-31 13:26:20 +01:00
pcmcia
peci
perf drivers/perf: hisi: Fix some event id for hisi-pcie-pmu 2022-12-31 13:25:40 +01:00
phy phy: qcom-qmp-combo: fix NULL-deref on runtime resume 2022-11-16 10:04:09 +01:00
pinctrl pinctrl: thunderbay: fix possible memory leak in thunderbay_build_functions() 2022-12-31 13:26:09 +01:00
platform platform/mellanox: mlxbf-pmc: Fix event typo 2022-12-31 13:25:48 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2022-12-31 13:25:43 +01:00
power power: supply: ab8500: Defer thermal zone probe 2022-12-02 17:43:02 +01:00
powercap powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue 2022-10-21 12:39:04 +02:00
pps
ps3
ptp
pwm
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-31 13:25:48 +01:00
ras
regulator regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe() 2022-12-31 13:26:11 +01:00
remoteproc remoteproc: Harden rproc_handle_vdev() against integer overflow 2022-10-21 12:38:45 +02:00
reset reset: npcm: fix iprst2 and iprst4 setting 2022-09-22 17:48:35 +02:00
rpmsg rpmsg: char: Avoid double destroy of default endpoint 2022-10-21 12:37:53 +02:00
rtc rtc: cmos: fix build on non-ACPI platforms 2022-12-19 12:41:01 +01:00
s390 s390/qeth: fix use-after-free in hsci 2022-12-14 11:41:06 +01:00
sbus
scsi scsi: hpsa: Fix possible memory leak in hpsa_init_one() 2022-12-31 13:26:20 +01:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:27:30 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:27:45 +01:00
soc soc: apple: rtkit: Stop casting function pointer signatures 2022-12-31 13:25:40 +01:00
soundwire soundwire: intel: Initialize clock stop timeout 2022-12-14 11:40:51 +01:00
spi spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode 2022-12-31 13:26:11 +01:00
spmi spmi: pmic-arb: correct duplicate APID to PPID mapping logic 2022-10-21 12:38:53 +02:00
ssb
staging media: staging: stkwebcam: Restore MEDIA_{USB,CAMERA}_SUPPORT dependencies 2022-12-31 13:26:11 +01:00
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-26 09:27:53 +01:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:43:03 +01:00
thermal thermal: core: fix some possible name leaks in error paths 2022-12-31 13:25:44 +01:00
thunderbolt thunderbolt: Add DP OUT resource when DP tunnel is discovered 2022-11-16 10:03:48 +01:00
tty Revert "tty: n_gsm: replace kicktimer with delayed_work" 2022-12-02 17:43:14 +01:00
ufs
uio
usb usb: musb: remove extra check in musb_gadget_vbus_draw 2022-12-31 13:25:34 +01:00
vdpa vdpa/mlx5: Fix MQ to support non power of two num queues 2022-09-27 18:32:45 -04:00
vfio vfio: Split the register_device ops call into functions 2022-11-26 09:27:52 +01:00
vhost vhost/vsock: Use kvmalloc/kvfree for larger packets. 2022-10-21 12:38:19 +02:00
video fbcon: Use kzalloc() in fbcon_prepare_logo() 2022-12-14 11:40:48 +01:00
virt virt/sev-guest: Add a MODULE_ALIAS 2022-12-31 13:25:56 +01:00
virtio
vlynq
w1
watchdog
xen xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2022-12-31 13:25:46 +01:00
zorro
Kconfig
Makefile