|
@@ -291,7 +291,7 @@ struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
|
|
error:
|
|
error:
|
|
/* If we have a client but no subdev, then something went wrong and
|
|
/* If we have a client but no subdev, then something went wrong and
|
|
we must unregister the client. */
|
|
we must unregister the client. */
|
|
- if (spi && sd == NULL)
|
|
|
|
|
|
+ if (!sd)
|
|
spi_unregister_device(spi);
|
|
spi_unregister_device(spi);
|
|
|
|
|
|
return sd;
|
|
return sd;
|