From: Peter Huewe Date: Sun, 3 Feb 2013 21:54:33 +0000 (+0100) Subject: staging/xgifb: Fix return of uninitialized variable X-Git-Tag: v3.12-rc1~1406^2~149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd1bbbb79eff1a4381328049b375c80c3fc8bff9;p=kernel%2Fkernel-generic.git staging/xgifb: Fix return of uninitialized variable 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index fa351f9..106abc8 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -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; }