linux-stable/drivers
Harshit Mogalapalli 9a98ab01e3 platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
commit f40f939917 upstream.

'attr_name_kobj' is allocated using kzalloc, but on all the error paths
it is not freed, hence we have a memory leak.

Fix the error path before kobject_init_and_add() by adding kfree().

kobject_put() must be always called after passing the object to
kobject_init_and_add(). Only the error path which is immediately next
to kobject_init_and_add() calls kobject_put() and not any other error
path after it.

Fix the error handling after kobject_init_and_add() by moving the
kobject_put() into the goto label err_other_attr_init that is already
used by all the error paths after kobject_init_and_add().

Fixes: a34fc329b1 ("platform/x86: hp-bioscfg: bioscfg")
Cc: stable@vger.kernel.org # 6.6.x: c5dbf04160: platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes()
Cc: stable@vger.kernel.org # 6.6.x: 5736aa9537: platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202309201412.on0VXJGo-lkp@intel.com/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
[ij: Added the stable dep tags]
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231113200742.3593548-3-harshit.m.mogalapalli@oracle.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-03 07:33:08 +01:00
..
accel accel/ivpu/37xx: Fix hangs related to MMIO reset 2023-12-03 07:33:04 +01:00
accessibility
acpi ACPI: PM: Add acpi_device_fix_up_power_children() function 2023-12-03 07:33:07 +01:00
amba
android binder: fix memory leaks of spam and pending work 2023-10-05 12:48:08 +02:00
ata ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-12-03 07:33:03 +01:00
atm atm: iphase: Do PCI error checks on own line 2023-11-28 17:19:43 +00:00
auxdisplay drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
base driver core: Release all resources during unbind before updating device links 2023-11-28 17:20:05 +00:00
bcma
block virtio-blk: fix implicit overflow on virtio_max_dma_size 2023-11-28 17:19:46 +00:00
bluetooth Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE 2023-11-28 17:20:07 +00:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-09-13 10:24:53 +03:00
cache riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT 2023-10-26 09:42:37 +02:00
cdrom
cdx
char parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table 2023-11-28 17:20:00 +00:00
clk clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks 2023-11-28 17:20:01 +00:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 17:19:36 +00:00
comedi Revert "comedi: add HAS_IOPORT dependencies" 2023-09-12 15:49:20 +02:00
connector Fix NULL pointer dereference in cn_filter() 2023-10-24 10:53:45 +02:00
counter First set of Counter fixes for 6.6 2023-10-02 13:13:15 +02:00
cpufreq cpufreq: stats: Fix buffer overflow detection in trans_stats() 2023-11-28 17:20:00 +00:00
cpuidle powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
crypto crypto: hisilicon/qm - prevent soft lockup in receive loop 2023-11-28 17:19:44 +00:00
cxl cxl/port: Fix delete_endpoint() vs parent unregistration race 2023-11-28 17:20:07 +00:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:59:00 +01:00
dio
dma dmaengine: stm32-mdma: correct desc prep when channel running 2023-11-28 17:20:05 +00:00
dma-buf dma-buf: add dma_fence_timestamp helper 2023-10-05 11:05:58 +02:00
edac Intel EDAC fixes: 2023-08-30 19:23:00 -07:00
eisa
extcon
firewire scsi: sd: Introduce manage_shutdown device flag 2023-10-27 10:00:19 +09:00
firmware firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit 2023-11-28 17:20:03 +00:00
fpga fpga: Fix memory leak for fpga_region_test_class_find() 2023-10-24 19:32:39 +02:00
fsi
gnss
gpio gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound 2023-11-28 17:19:43 +00:00
gpu drm/ast: Disconnect BMC if physical connector is connected 2023-12-03 07:33:06 +01:00
greybus
hid HID: fix HID device resource race between HID core and debugging support 2023-12-03 07:33:04 +01:00
hsi
hte hte: tegra: Fix missing error code in tegra_hte_test_probe() 2023-11-20 11:59:08 +01:00
hv hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
hwmon hwmon: (sch5627) Disallow write access if virtual registers are locked 2023-11-20 11:59:08 +01:00
hwspinlock
hwtracing coresight: tmc-etr: Disable warnings for allocation failures 2023-09-20 10:46:30 +01:00
i2c i2c: i801: fix potential race in i801_block_transaction_byte_by_byte 2023-11-28 17:20:11 +00:00
i3c i3c: master: svc: fix random hot join failure since timeout error 2023-11-28 17:20:06 +00:00
idle
iio iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() 2023-11-28 17:19:45 +00:00
infiniband RDMA/hfi1: Use FIELD_GET() to extract Link Width 2023-11-28 17:19:42 +00:00
input Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() 2023-11-20 11:59:34 +01:00
interconnect interconnect: fix error handling in qnoc_probe() 2023-11-20 11:59:27 +01:00
iommu iommufd: Fix missing update of domains_itree after splitting iopt_area 2023-11-28 17:19:57 +00:00
ipack
irqchip irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs 2023-12-03 07:33:02 +01:00
isdn isdn: mISDN: hfcsusb: Spelling fix in comment 2023-10-23 09:39:46 +01:00
leds leds: trigger: netdev: Move size check in set_device_name 2023-11-28 17:20:03 +00:00
macintosh powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
mailbox mailbox: qcom-ipcc: fix incorrect num_chans counting 2023-09-05 10:11:01 -05:00
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 17:20:05 +00:00
md bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race 2023-12-03 07:33:07 +01:00
media media: qcom: camss: Fix csid-gen2 for test pattern generator 2023-11-28 17:20:15 +00:00
memory memory: tegra: Set BPMP msg flags to reset IPC channels 2023-11-20 11:59:17 +01:00
memstick
message
mfd mfd: qcom-spmi-pmic: Fix revid implementation 2023-11-28 17:20:03 +00:00
misc misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller 2023-11-28 17:19:44 +00:00
mmc mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER 2023-11-28 17:20:14 +00:00
most
mtd mtd: cfi_cmdset_0001: Byte swap OTP info 2023-11-28 17:20:06 +00:00
mux
net net: ipa: fix one GSI register field width 2023-12-03 07:33:05 +01:00
nfc NFC: nxp: add NXP1002 2023-08-30 18:32:24 -07:00
ntb
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 11:59:19 +01:00
nvme nvmet: nul-terminate the NQNs passed in the connect command 2023-12-03 07:33:06 +01:00
nvmem nvmem: imx: correct nregs for i.MX6ULL 2023-10-16 21:00:08 +02:00
of of: address: Fix address translation when address-size is greater than 2 2023-11-28 17:19:39 +00:00
opp
parisc parisc/power: Fix power soft-off when running on qemu 2023-11-28 17:20:08 +00:00
parport TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
pci PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card 2023-11-28 17:20:02 +00:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:59:31 +01:00
peci
perf drivers: perf: Check find_first_bit() return value 2023-11-28 17:19:54 +00:00
phy phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs 2023-11-28 17:19:45 +00:00
pinctrl pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() 2023-11-20 11:59:25 +01:00
platform platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes() 2023-12-03 07:33:08 +01:00
pmdomain pmdomain: imx: Make imx pgc power domain also set the fwnode 2023-11-28 17:20:00 +00:00
pnp
power power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint 2023-11-08 11:56:20 +01:00
powercap powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() 2023-11-28 17:20:00 +00:00
pps
ps3
ptp ptp: annotate data-race around q->head and q->tail 2023-11-28 17:19:51 +00:00
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 11:59:34 +01:00
rapidio
ras
regulator regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve 2023-11-20 11:59:07 +01:00
remoteproc remoteproc updates for v6.6 2023-09-04 15:12:26 -07:00
reset This pull request is full of clk driver changes. In fact, there aren't any 2023-08-30 19:53:39 -07:00
rpmsg rpmsg updates for v6.6 2023-09-04 15:08:52 -07:00
rtc rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call 2023-11-20 11:59:30 +01:00
s390 s390/dasd: protect device queue against concurrent access 2023-12-03 07:33:07 +01:00
sbus
scsi scsi: qla2xxx: Fix system crash due to bad pointer access 2023-11-28 17:19:55 +00:00
sh
siox
slimbus
soc soc: qcom: pmic: Fix resource leaks in a device_for_each_child_node() loop 2023-11-28 17:19:41 +00:00
soundwire soundwire: dmi-quirks: update HP Omen match 2023-11-28 17:19:45 +00:00
spi spi: Fix null dereference on suspend 2023-11-28 17:19:55 +00:00
spmi
ssb
staging media: cedrus: Fix clock/reset sequence 2023-11-20 11:59:32 +01:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-09-27 10:55:29 -04:00
tc
tee ARM: SoC fixes for 6.6, part 2 2023-10-12 11:52:23 -07:00
thermal thermal: intel: powerclamp: fix mismatch in get function for max_idle 2023-11-28 17:20:02 +00:00
thunderbolt thunderbolt: Set lane bonding bit only for downstream port 2023-12-03 07:33:06 +01:00
tty hvc/xen: fix event channel handling for secondary consoles 2023-11-28 17:19:57 +00:00
ufs scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR 2023-11-28 17:19:55 +00:00
uio
usb USB: dwc3: qcom: fix ACPI platform device leak 2023-12-03 07:33:06 +01:00
vdpa vdpa_sim_blk: allocate the buffer zeroed 2023-11-28 17:19:49 +00:00
vfio vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() 2023-09-22 12:48:04 -06:00
vhost vhost-vdpa: fix use after free in vhost_vdpa_probe() 2023-11-28 17:19:49 +00:00
video fbdev: fsl-diu-fb: mark wr_reg_wa() static 2023-11-20 11:59:38 +01:00
virt virt: sevguest: Fix passing a stack buffer as a scatterlist target 2023-11-20 11:59:30 +01:00
virtio virtio_pci: fix the common cfg map size 2023-10-18 11:30:12 -04:00
vlynq
w1 w1: ds2482: Switch back to use struct i2c_driver's .probe() 2023-09-13 10:48:42 +02:00
watchdog sbsa_gwdt: Calculate timeout with 64-bit math 2023-11-28 17:20:11 +00:00
xen swiotlb-xen: provide the "max_mapping_size" method 2023-12-03 07:33:07 +01:00
zorro
Kconfig Merge patch series "Add non-coherent DMA support for AX45MP" 2023-09-08 11:24:34 -07:00
Makefile pmdomain: Rename the genpd subsystem to pmdomain 2023-09-13 11:09:21 +02:00