linuxkpi: Remove extraneous NULL check on M_WAITOK allocation

The check was not introduced in r342628, but the subsequent unchecked access to
refs was added then, prompting a Coverity warning about "Null pointer
dereferences (FORWARD_NULL)."  The warning is bogus due to M_WAITOK, but so is
the NULL check that hints it, so just remove it.

CID:		1398588
Reported by:	Coverity
This commit is contained in:
Conrad Meyer 2019-01-01 19:56:49 +00:00
parent 70de14d82f
commit 85f2a00b34
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=342670

View File

@ -71,8 +71,7 @@ cdev_alloc(void)
struct linux_cdev *cdev;
cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK);
if (cdev != NULL)
kobject_init(&cdev->kobj, &linux_cdev_ktype);
kobject_init(&cdev->kobj, &linux_cdev_ktype);
cdev->refs = 1;
return (cdev);
}