Patch "USB: serial: mos7840: fix error code in mos7840_write()" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    USB: serial: mos7840: fix error code in mos7840_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-mos7840-fix-error-code-in-mos7840_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 a70aa7dc60099bbdcbd6faca42a915d80f31161e Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date: Tue, 26 Jan 2021 13:26:54 +0300
Subject: USB: serial: mos7840: fix error code in mos7840_write()

From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

commit a70aa7dc60099bbdcbd6faca42a915d80f31161e upstream.

This should return -ENOMEM instead of 0 if the kmalloc() fails.

Fixes: 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/serial/mos7840.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -883,8 +883,10 @@ static int mos7840_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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux