mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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:
committed by
Greg Kroah-Hartman
parent
854472c270
commit
5effdf7081
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user