]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/xgifb: Fix return of uninitialized variable
authorPeter Huewe <peterhuewe@gmx.de>
Sun, 3 Feb 2013 21:54:33 +0000 (22:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Feb 2013 18:46:27 +0000 (10:46 -0800)
Clang warning:
drivers/staging/xgifb/XGI_main_26.c: warning: variable 'ret' is
used uninitialized whenever 'if' condition:
if (xgifb_info->mode_idx < 0) {
evaluates to true.

drivers/staging/xgifb/XGI_main_26.c:
note: uninitialized use occurs here
return ret;

This patch initializes the variable in this case.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c

index fa351f90da3356648923fa6f7eccc79f19ae75fe..106abc8d9cbbb3d31e311952fc018ad93034e994 100644 (file)
@@ -1921,6 +1921,7 @@ static int xgifb_probe(struct pci_dev *pdev,
 
        if (xgifb_info->mode_idx < 0) {
                dev_err(&pdev->dev, "No supported video mode found\n");
+               ret = -EINVAL;
                goto error_1;
        }