diff mbox

neofb: fix error return code in neofb_probe()

Message ID CAPgLHd8sm1rhuuG7TJqAfWesiSDf6MaM4E4VCrrWXGziLEiYVA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Sept. 23, 2013, 3 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/video/neofb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tomi Valkeinen Sept. 26, 2013, 8:46 a.m. UTC | #1
On 23/09/13 18:00, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/video/neofb.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
> index 891b0bf..2a3e5bd 100644
> --- a/drivers/video/neofb.c
> +++ b/drivers/video/neofb.c
> @@ -2075,6 +2075,7 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	if (!fb_find_mode(&info->var, info, mode_option, NULL, 0,
>  			info->monspecs.modedb, 16)) {
>  		printk(KERN_ERR "neofb: Unable to find usable video mode.\n");
> +		err = -EINVAL;
>  		goto err_map_video;
>  	}
>  
> @@ -2097,7 +2098,8 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	       info->fix.smem_len >> 10, info->var.xres,
>  	       info->var.yres, h_sync / 1000, h_sync % 1000, v_sync);
>  
> -	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
> +	err = fb_alloc_cmap(&info->cmap, 256, 0);
> +	if (err < 0)
>  		goto err_map_video;
>  
>  	err = register_framebuffer(info);
> 

Thanks, queuing for 3.12 fixes.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 891b0bf..2a3e5bd 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -2075,6 +2075,7 @@  static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (!fb_find_mode(&info->var, info, mode_option, NULL, 0,
 			info->monspecs.modedb, 16)) {
 		printk(KERN_ERR "neofb: Unable to find usable video mode.\n");
+		err = -EINVAL;
 		goto err_map_video;
 	}
 
@@ -2097,7 +2098,8 @@  static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	       info->fix.smem_len >> 10, info->var.xres,
 	       info->var.yres, h_sync / 1000, h_sync % 1000, v_sync);
 
-	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
+	err = fb_alloc_cmap(&info->cmap, 256, 0);
+	if (err < 0)
 		goto err_map_video;
 
 	err = register_framebuffer(info);