Patch "rtc: wm8350: Handle error for wm8350_register_irq" has been added to the 5.15-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

    rtc: wm8350: Handle error for wm8350_register_irq

to the 5.15-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:
     rtc-wm8350-handle-error-for-wm8350_register_irq.patch
and it can be found in the queue-5.15 subdirectory.

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



commit ec4907ae3354cb6f2a548f7f851cb8ec60c23e25
Author: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Date:   Thu Mar 3 16:50:30 2022 +0800

    rtc: wm8350: Handle error for wm8350_register_irq
    
    [ Upstream commit 43f0269b6b89c1eec4ef83c48035608f4dcdd886 ]
    
    As the potential failure of the wm8350_register_irq(),
    it should be better to check it and return error if fails.
    Also, it need not free 'wm_rtc->rtc' since it will be freed
    automatically.
    
    Fixes: 077eaf5b40ec ("rtc: rtc-wm8350: add support for WM8350 RTC")
    Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
    Acked-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220303085030.291793-1-jiasheng@xxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index 2018614f258f..6eaa9321c074 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -432,14 +432,21 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC,
+	ret = wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC,
 			    wm8350_rtc_update_handler, 0,
 			    "RTC Seconds", wm8350);
+	if (ret)
+		return ret;
+
 	wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
 
-	wm8350_register_irq(wm8350, WM8350_IRQ_RTC_ALM,
+	ret = wm8350_register_irq(wm8350, WM8350_IRQ_RTC_ALM,
 			    wm8350_rtc_alarm_handler, 0,
 			    "RTC Alarm", wm8350);
+	if (ret) {
+		wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350);
+		return ret;
+	}
 
 	return 0;
 }



[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