]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-cmos.c: propagate hpet_register_irq_handler() failure
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Jan 2014 03:10:24 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:24 +0000 (14:10 +1100)
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>
drivers/rtc/rtc-cmos.c

index ed5540d78a80ca749dd153bace8b7a8c10add4f3..10016e1e682aff6eb091eb86a565e81f406990da 100644 (file)
@@ -708,11 +708,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;