Skip to content

Commit

Permalink
staging/xgifb: Fix return of uninitialized variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Huewe authored and Greg Kroah-Hartman committed Feb 4, 2013
1 parent 8cedcc7 commit fd1bbbb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/xgifb/XGI_main_26.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fd1bbbb

Please sign in to comment.