Patch "serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed" has been added to the 6.7-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

    serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed

to the 6.7-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:
     serial-8250-omap-don-t-skip-resource-freeing-if-pm_r.patch
and it can be found in the queue-6.7 subdirectory.

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



commit 1e507cf9de5cc3b0a66eec3788d7c0fd665c13e1
Author: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Date:   Fri Nov 10 16:29:29 2023 +0100

    serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed
    
    [ Upstream commit ad90d0358bd3b4554f243a425168fc7cebe7d04e ]
    
    Returning an error code from .remove() makes the driver core emit the
    little helpful error message:
    
            remove callback returned a non-zero value. This will be ignored.
    
    and then remove the device anyhow. So all resources that were not freed
    are leaked in this case. Skipping serial8250_unregister_port() has the
    potential to keep enough of the UART around to trigger a use-after-free.
    
    So replace the error return (and with it the little helpful error
    message) by a more useful error message and continue to cleanup.
    
    Fixes: e3f0c638f428 ("serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
    Reviewed-by: Tony Lindgren <tony@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231110152927.70601-2-u.kleine-koenig@xxxxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 578f35895b27..dd2be7a813c3 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1594,7 +1594,7 @@ static int omap8250_remove(struct platform_device *pdev)
 
 	err = pm_runtime_resume_and_get(&pdev->dev);
 	if (err)
-		return err;
+		dev_err(&pdev->dev, "Failed to resume hardware\n");
 
 	up = serial8250_get_port(priv->line);
 	omap_8250_shutdown(&up->port);




[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