This is a note to let you know that I've just added the patch titled USB: serial: mos7720: fix error code in mos7720_write() to the 5.11-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: usb-serial-mos7720-fix-error-code-in-mos7720_write.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From fea7372cbc40869876df0f045e367f6f97a1666c Mon Sep 17 00:00:00 2001 From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Date: Thu, 28 Jan 2021 12:35:23 +0300 Subject: USB: serial: mos7720: fix error code in mos7720_write() From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> commit fea7372cbc40869876df0f045e367f6f97a1666c upstream. This code should return -ENOMEM if the kmalloc() fails but instead it returns success. Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Fixes: 0f64478cbc7a ("USB: add USB serial mos7720 driver") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Johan Hovold <johan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/mos7720.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -1092,8 +1092,10 @@ static int mos7720_write(struct tty_stru if (urb->transfer_buffer == NULL) { urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); - if (!urb->transfer_buffer) + if (!urb->transfer_buffer) { + bytes_sent = -ENOMEM; goto exit; + } } transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); Patches currently in stable-queue which might be from dan.carpenter@xxxxxxxxxx are queue-5.11/media-allegro-fix-use-after-free-on-error.patch queue-5.11/asoc-cs42l56-fix-up-error-handling-in-probe.patch queue-5.11/media-atomisp-fix-a-buffer-overflow-in-debug-code.patch queue-5.11/media-camss-missing-error-code-in-msm_video_register.patch queue-5.11/staging-vchiq-fix-bulk-transfers-on-64-bit-builds.patch queue-5.11/mtd-parser-imagetag-fix-error-codes-in-bcm963xx_pars.patch queue-5.11/asoc-cpcap-fix-microphone-timeslot-mask.patch queue-5.11/drm-amdgpu-prevent-shift-wrapping-in-amdgpu_read_mas.patch queue-5.11/drm-virtio-fix-an-error-code-in-virtio_gpu_init.patch queue-5.11/rdma-rtrs-srv-do-not-pass-a-valid-pointer-to-ptr_err.patch queue-5.11/soc-qcom-socinfo-fix-an-off-by-one-in-qcom_show_pmic.patch queue-5.11/media-camss-fix-signedness-bug-in-video_enum_fmt.patch queue-5.11/gma500-clean-up-error-handling-in-init.patch queue-5.11/input-joydev-prevent-potential-read-overflow-in-ioctl.patch queue-5.11/nvmem-core-fix-a-resource-leak-on-error-in-nvmem_add.patch queue-5.11/input-elo-fix-an-error-code-in-elo_connect.patch queue-5.11/usb-serial-mos7840-fix-error-code-in-mos7840_write.patch queue-5.11/usb-serial-mos7720-fix-error-code-in-mos7720_write.patch queue-5.11/ath11k-fix-a-locking-bug-in-ath11k_mac_op_start.patch queue-5.11/staging-vchiq-fix-bulk-userdata-handling.patch queue-5.11/phy-cadence-torrent-fix-error-code-in-cdns_torrent_p.patch queue-5.11/octeontx2-af-fix-an-off-by-one-in-rvu_dbg_qsize_writ.patch queue-5.11/input-sur40-fix-an-error-code-in-sur40_probe.patch queue-5.11/scsi-lpfc-fix-ancient-double-free.patch queue-5.11/staging-gdm724x-fix-dma-from-stack.patch queue-5.11/mfd-wm831x-auxadc-prevent-use-after-free-in-wm831x_a.patch queue-5.11/ocfs2-fix-a-use-after-free-on-error.patch queue-5.11/scsi-sd-sd_zbc-don-t-pass-gfp_noio-to-kvcalloc.patch