Also, clarify the 'ring' allocation failure by returning NULL instead of 'ring' (which would be NULL). Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/mite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index 1e537a5..79b5597 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -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; } -- 2.3.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel