The patch titled Subject: rapidio: fix potential NULL pointer dereference has been added to the -mm tree. Its filename is rapidio-fix-potential-null-pointer-dereference.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/rapidio-fix-potential-null-pointer-dereference.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/rapidio-fix-potential-null-pointer-dereference.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vladimir Zapolskiy <vz@xxxxxxxxx> Subject: rapidio: fix potential NULL pointer dereference The change fixes improper check for a returned error value by class_create() function, which on error returns ERR_PTR() value, thus the original check always results in a dead code on error path. Signed-off-by: Vladimir Zapolskiy <vz@xxxxxxxxx> Signed-off-by: Alexandre Bounine <alexandre.bounine@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rapidio/devices/rio_mport_cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/rapidio/devices/rio_mport_cdev.c~rapidio-fix-potential-null-pointer-dereference drivers/rapidio/devices/rio_mport_cdev.c --- a/drivers/rapidio/devices/rio_mport_cdev.c~rapidio-fix-potential-null-pointer-dereference +++ a/drivers/rapidio/devices/rio_mport_cdev.c @@ -2669,9 +2669,9 @@ static int __init mport_init(void) /* Create device class needed by udev */ dev_class = class_create(THIS_MODULE, DRV_NAME); - if (!dev_class) { + if (IS_ERR(dev_class)) { rmcd_error("Unable to create " DRV_NAME " class"); - return -EINVAL; + return PTR_ERR(dev_class); } ret = alloc_chrdev_region(&dev_number, 0, RIO_MAX_MPORTS, DRV_NAME); _ Patches currently in -mm which might be from vz@xxxxxxxxx are rapidio-fix-potential-null-pointer-dereference.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html