]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-cmos.c: propagate hpet_register_irq_handler() failure
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 23 Jan 2014 23:55:15 +0000 (15:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:00 +0000 (16:37 -0800)
If hpet_register_irq_handler() fails, cmos_do_probe() will incorrectly
return 0.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-cmos.c

index f28b45856d66e5b4c8363a7421ac0b21d6953439..cae212f30d6512f481b9dba7070f25aa00ce2c3d 100644 (file)
@@ -756,11 +756,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
                irq_handler_t rtc_cmos_int_handler;
 
                if (is_hpet_enabled()) {
-                       int err;
-
                        rtc_cmos_int_handler = hpet_rtc_interrupt;
-                       err = hpet_register_irq_handler(cmos_interrupt);
-                       if (err != 0) {
+                       retval = hpet_register_irq_handler(cmos_interrupt);
+                       if (retval) {
                                dev_warn(dev, "hpet_register_irq_handler "
                                                " failed in rtc_init().");
                                goto cleanup1;