staging: comedi: mite: (!foo) preferred over (foo == NULL)

Also, clarify the 'ring' allocation failure by returning NULL instead
of 'ring' (which would be NULL).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten
2015-03-04 12:15:33 -07:00
committed by Greg Kroah-Hartman
parent 854472c270
commit 5effdf7081

View File

@@ -186,10 +186,10 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite)
struct mite_dma_descriptor_ring *ring =
kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL);
if (ring == NULL)
return ring;
if (!ring)
return NULL;
ring->hw_dev = get_device(&mite->pcidev->dev);
if (ring->hw_dev == NULL) {
if (!ring->hw_dev) {
kfree(ring);
return NULL;
}