tty: serial: tegra: check function's return value
Sri Krishna chowdary [Mon, 29 Oct 2012 13:02:30 +0000 (18:02 +0530)]
Platform_get_irq returns int. So, the check should
be (int)irq < 0 not irq < 0 which has no effect as irq
is unsigned.

Bug 1046331

Change-Id: I6599f34ef42bcd286908b4bdd029639231fb9a3d
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/159553
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/tty/serial/tegra_hsuart.c

index 0cd439e..4ece2a6 100644 (file)
@@ -1573,7 +1573,7 @@ static int __init tegra_uart_probe(struct platform_device *pdev)
        u->iotype = UPIO_MEM32;
 
        u->irq = platform_get_irq(pdev, 0);
-       if (unlikely(u->irq < 0)) {
+       if (unlikely((int)(u->irq) < 0)) {
                ret = -ENXIO;
                goto fail;
        }