Patch "can: softing_cs: softingcs_probe(): fix memleak on registration failure" has been added to the 5.10-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

    can: softing_cs: softingcs_probe(): fix memleak on registration failure

to the 5.10-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:
     can-softing_cs-softingcs_probe-fix-memleak-on-registration-failure.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From ced4913efb0acc844ed65cc01d091a85d83a2082 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Wed, 22 Dec 2021 11:48:43 +0100
Subject: can: softing_cs: softingcs_probe(): fix memleak on registration failure

From: Johan Hovold <johan@xxxxxxxxxx>

commit ced4913efb0acc844ed65cc01d091a85d83a2082 upstream.

In case device registration fails during probe, the driver state and
the embedded platform device structure needs to be freed using
platform_device_put() to properly free all resources (e.g. the device
name).

Fixes: 0a0b7a5f7a04 ("can: add driver for Softing card")
Link: https://lore.kernel.org/all/20211222104843.6105-1-johan@xxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx # 2.6.38
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/net/can/softing/softing_cs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -293,7 +293,7 @@ static int softingcs_probe(struct pcmcia
 	return 0;
 
 platform_failed:
-	kfree(dev);
+	platform_device_put(pdev);
 mem_failed:
 pcmcia_bad:
 pcmcia_failed:


Patches currently in stable-queue which might be from johan@xxxxxxxxxx are

queue-5.10/media-mceusb-fix-control-message-timeouts.patch
queue-5.10/media-flexcop-usb-fix-control-message-timeouts.patch
queue-5.10/media-stk1160-fix-control-message-timeouts.patch
queue-5.10/media-pvrusb2-fix-control-message-timeouts.patch
queue-5.10/media-s2255-fix-control-message-timeouts.patch
queue-5.10/media-cpia2-fix-control-message-timeouts.patch
queue-5.10/media-redrat3-fix-control-message-timeouts.patch
queue-5.10/can-softing_cs-softingcs_probe-fix-memleak-on-registration-failure.patch
queue-5.10/media-em28xx-fix-control-message-timeouts.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