Patch "Revert "usbtmc: convert to devm_kzalloc"" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
Revert "usbtmc: convert to devm_kzalloc"
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
revert-usbtmc-convert-to-devm_kzalloc.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ab21b63e8aedfc73565dd9cdd51eb338341177cbMon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <[email protected]>
Date: Wed, 28 Sep 2016 11:48:44 +0200
Subject: Revert "usbtmc: convert to devm_kzalloc"
From: Greg Kroah-Hartman <[email protected]>
commit ab21b63e8aedfc73565dd9cdd51eb338341177cb upstream.
This reverts commit e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.
Turns out it was totally wrong. The memory is supposed to be bound to the kref, as the original code was doing correctly, not the device/driver binding as the devm_kzalloc() would cause.
This fixes an oops when read would be called after the device was unbound from the driver.
--- drivers/usb/class/usbtmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/class/usbtmc.c +2 -1
@@ -121,6 +121,7 @@ static void usbtmc_delete(struct kref *kstruct usbtmc_device_data *data =to_usbtmc_data (kref);usb_put_dev (data->usb_dev); +kfree (data); }static int usbtmc_open (struct inode *inode,struct file *filp)
@@ -1104,7 +1105,7 @@ static int usbtmc_probe(struct usb_interdev_dbg (&intf->dev,"%s called\n" , __func__); - data =devm_kzalloc (&intf->dev,sizeof (*data),GFP_KERNEL ); + data =kmalloc (sizeof (*data),GFP_KERNEL );if (!data)return -ENOMEM ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/tile-define-at_vector_size_arch-for-arch_dlinfo.patch queue-4.4/ib-mlx4-fix-code-indentation-in-qp1-mad-flow.patch queue-4.4/printk-fix-parsing-of-brl-option.patch queue-4.4/regulator-qcom_smd-fix-voltage-ranges-for-pm8x41.patch queue-4.4/usb-misc-legousbtower-fix-null-pointer-deference.patch queue-4.4/ib-ipoib-fix-memory-corruption-in-ipoib-cm-mode-connect-flow.patch queue-4.4/iwlwifi-pcie-fix-access-to-scratch-buffer.patch queue-4.4/fnic-pci_dma_mapping_error-doesn-t-return-an-error-code.patch queue-4.4/dmaengine-at_xdmac-fix-debug-string.patch queue-4.4/aio-mark-aio-pseudo-fs-noexec.patch queue-4.4/mmc-pxamci-fix-potential-oops.patch queue-4.4/sysctl-handle-error-writing-uint_max-to-u32-fields.patch queue-4.4/dmaengine-at_xdmac-fix-to-pass-correct-device-identity-to-free_irq.patch queue-4.4/avr32-off-by-one-in-at32_init_pio.patch queue-4.4/arm-sa1100-fix-3.6864mhz-clock.patch queue-4.4/kvm-nvmx-postpone-vmcs-changes-on-msr_ia32_apicbase-write.patch queue-4.4/regulator-qcom_spmi-add-support-for-s4-supply-on-pm8941.patch queue-4.4/gspca-avoid-unused-variable-warnings.patch queue-4.4/tools-vm-slabinfo-fix-an-unintentional-printf.patch queue-4.4/irqchip-gicv3-silence-noisy-debug_per_cpu_maps-warning.patch queue-4.4/arm-8616-1-dt-respect-property-size-when-parsing-cpus.patch queue-4.4/brcmfmac-fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch queue-4.4/usb-serial-cp210x-fix-hardware-flow-control-disable.patch queue-4.4/pnfs-flexfiles-fix-layoutcommit-after-a-commit-to-ds.patch queue-4.4/pstore-drop-file-opened-reference-count.patch queue-4.4/mips-uprobes-fix-use-of-uninitialised-variable.patch queue-4.4/drivers-perf-arm_pmu-fix-leak-in-error-path.patch queue-4.4/mips-fix-uretprobe-implementation.patch queue-4.4/kernel-fork-fix-clone_child_cleartid-regression-in-nscd.patch queue-4.4/ipvs-fix-bind-to-link-local-mcast-ipv6-address-in-backup.patch queue-4.4/brcmsmac-free-packet-if-dma_mapping_error-fails-in-dma_rxfill.patch queue-4.4/usb-musb-fix-dma-for-host-mode.patch queue-4.4/dm-log-writes-fix-bug-with-too-large-bios.patch queue-4.4/pinctrl-flag-strict-is-a-field-in-struct-pinmux_ops.patch queue-4.4/clk-xgene-add-missing-parenthesis-when-clearing-divider-value.patch queue-4.4/batman-adv-remove-unused-callback-from-batadv_algo_ops-struct.patch queue-4.4/x86-init-fix-cr4_init_shadow-on-cr4-less-machines.patch queue-4.4/i40e-avoid-null-pointer-dereference.patch queue-4.4/nfc-fdp-detect-errors-from-fdp_nci_create_conn.patch queue-4.4/hwrng-omap-fix-assumption-that-runtime_get_sync-will-always-succeed.patch queue-4.4/mips-malta-fix-iocu-disable-switch-read-for-mips64.patch queue-4.4/ib-core-fix-use-after-free-in-send_leave-function.patch queue-4.4/arm-shmobile-fix-regulator-quirk-for-gen2.patch queue-4.4/arm-sa1100-register-clocks-early.patch queue-4.4/mm-ksm-fix-endless-looping-in-allocating-memory-when-ksm-enable.patch queue-4.4/svc-avoid-garbage-replies-when-pc_func-returns-rpc_drop_reply.patch queue-4.4/asoc-intel-skylake-fix-error-return-code-in-skl_probe.patch queue-4.4/can-dev-fix-deadlock-reported-after-bus-off.patch queue-4.4/arm-sun5i-fix-typo-in-trip-point-temperature.patch queue-4.4/alsa-hda-adding-one-more-alc255-pin-definition-for-headset-problem.patch queue-4.4/revert-usbtmc-convert-to-devm_kzalloc.patch queue-4.4/regulator-qcom_spmi-update-mvs1-mvs2-switches-on-pm8941.patch queue-4.4/iwlwifi-mvm-don-t-use-ret-when-not-initialised.patch queue-4.4/arm-8618-1-decompressor-reset-ttbcr-fields-to-use-ttbr0-on-armv7.patch queue-4.4/iwlmvm-mvm-set-correct-state-in-smart-fifo-configuration.patch queue-4.4/ath9k-fix-programming-of-mincca-power-threshold.patch queue-4.4/mips-uprobes-remove-incorrect-set_orig_insn.patch queue-4.4/pnfs-files-fix-layoutcommit-after-a-commit-to-ds.patch queue-4.4/regulator-qcom_spmi-add-support-for-get_mode-set_mode-on-switches.patch queue-4.4/cpuset-handle-race-between-cpu-hotplug-and-cpuset_hotplug_work.patch queue-4.4/x86-boot-initialize-fpu-and-x86_feature_always-even-if-we-don-t-have-cpuid.patch queue-4.4/mtd-nand-davinci-reinitialize-the-hw-ecc-engine-in-4bit-hwctl.patch queue-4.4/pinctrl-uniphier-fix-.pin_dbg_show-callback.patch queue-4.4/em28xx-i2c-rt_mutex_trylock-returns-zero-on-failure.patch queue-4.4/usb-serial-cp210x-add-id-for-a-juniper-console.patch queue-4.4/drm-radeon-si-dpm-add-workaround-for-for-jet-parts.patch queue-4.4/ib-mlx4-use-correct-subnet-prefix-in-qp1-mads-under-sr-iov.patch queue-4.4/arm64-debug-avoid-resetting-stepping-state-machine-when-tif_singlestep.patch queue-4.4/perf-core-fix-pmu-filter_match-for-sw-led-groups.patch queue-4.4/staging-fbtft-fix-bug-in-fbtft-core.patch queue-4.4/iwlwifi-mvm-fix-a-few-firmware-capability-checks.patch queue-4.4/ib-ipoib-don-t-allow-mc-joins-during-light-mc-flush.patch queue-4.4/nfs-don-t-drop-cb-requests-with-invalid-principals.patch queue-4.4/blk-mq-actually-hook-up-defer-list-when-running-requests.patch queue-4.4/gpio-sa1100-fix-irq-probing-for-ucb1x00.patch queue-4.4/powerpc-prom-fix-sub-processor-option-passed-to-ibm-client-architecture-support.patch queue-4.4/brcmsmac-initialize-power-in-brcms_c_stf_ss_algo_channel_get.patch queue-4.4/arm-8617-1-dma-fix-dma_max_pfn.patch queue-4.4/hwmon-adt7411-set-bit-3-in-cfg1-register.patch queue-4.4/drm-nouveau-fifo-nv04-avoid-ramht-race-against-cookie-insertion.patch queue-4.4/ceph-fix-race-during-filling-readdir-cache.patch queue-4.4/nvmem-declare-nvmem_cell_read-consistently.patch queue-4.4/asoc-omap-mcpdm-fix-irq-resource-handling.patch queue-4.4/spi-sh-msiof-avoid-invalid-clock-generator-parameters.patch queue-4.4/arm-sa1100-clear-reset-status-prior-to-reboot.patch queue-4.4/usb-gadget-fsl_qe_udc-signedness-bug-in-qe_get_frame.patch queue-4.4/ib-mlx4-fix-incorrect-mc-join-state-bit-masking-on-sr-iov.patch queue-4.4/usb-musb-fix-dma-desired-mode-for-mentor-dma-engine.patch queue-4.4/tpm-fix-byte-order-for-the-value-read-by-tpm2_get_tpm_pt.patch queue-4.4/arm-sa1111-fix-pcmcia-suspend-resume.patch