|
|
@@ -1255,6 +1255,10 @@ static int pi433_probe(struct spi_device *spi)
|
|
|
|
|
|
/* create cdev */
|
|
|
device->cdev = cdev_alloc();
|
|
|
+ if (!device->cdev) {
|
|
|
+ dev_dbg(device->dev, "allocation of cdev failed");
|
|
|
+ goto cdev_failed;
|
|
|
+ }
|
|
|
device->cdev->owner = THIS_MODULE;
|
|
|
cdev_init(device->cdev, &pi433_fops);
|
|
|
retval = cdev_add(device->cdev, device->devt, 1);
|