From: Joonwoo Park Date: Wed, 26 Aug 2009 21:29:18 +0000 (-0700) Subject: pps: fix incorrect verdict check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=054b2b13ccba4876a1ce98a7ede7dab7d6893d01;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git pps: fix incorrect verdict check Fix incorrect verdict check and returns error if device_create failed, otherwise driver triggers kernel oops. Signed-off-by: Joonwoo Park Cc: Rodolfo Giometti Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c index ac8cc8cea1e3..fea17e7805e9 100644 --- a/drivers/pps/pps.c +++ b/drivers/pps/pps.c @@ -244,7 +244,7 @@ int pps_register_cdev(struct pps_device *pps) } pps->dev = device_create(pps_class, pps->info.dev, pps->devno, NULL, "pps%d", pps->id); - if (err) + if (IS_ERR(pps->dev)) goto del_cdev; dev_set_drvdata(pps->dev, pps);