Commit 5effdf70 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 854472c2
...@@ -186,10 +186,10 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite) ...@@ -186,10 +186,10 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite)
struct mite_dma_descriptor_ring *ring = struct mite_dma_descriptor_ring *ring =
kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL); kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL);
if (ring == NULL) if (!ring)
return ring; return NULL;
ring->hw_dev = get_device(&mite->pcidev->dev); ring->hw_dev = get_device(&mite->pcidev->dev);
if (ring->hw_dev == NULL) { if (!ring->hw_dev) {
kfree(ring); kfree(ring);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment