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<joonwpark81@gmail.com>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joonwoo Park 2009-08-26 14:29:18 -07:00 committed by Linus Torvalds
parent f415c413f4
commit 054b2b13cc

View file

@ -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);