]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/rtc/rtc-88pm860x.c
rtc: 88pm860x: prevent use-after-free on device remove
[linux.git] / drivers / rtc / rtc-88pm860x.c
index d25282b4a7dd1c8798569e79537f9a0682214a30..73697e4b18a9d4d9d85546a1d807a861966df8d8 100644 (file)
@@ -421,7 +421,7 @@ static int pm860x_rtc_remove(struct platform_device *pdev)
        struct pm860x_rtc_info *info = platform_get_drvdata(pdev);
 
 #ifdef VRTC_CALIBRATION
-       flush_scheduled_work();
+       cancel_delayed_work_sync(&info->calib_work);
        /* disable measurement */
        pm860x_set_bits(info->i2c, PM8607_MEAS_EN2, MEAS2_VRTC, 0);
 #endif /* VRTC_CALIBRATION */