diff mbox

s3fb: fix error return code in s3_pci_probe()

Message ID CAPgLHd_wsqGQ2eSnKY6SzGan0fZLZJWyN03A+_aFmaQ51q73AQ@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 -EINVAL when virtual vertical size smaller than real
instead of 0, as done elsewhere in this function. Also remove dup code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/video/s3fb.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)


--
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:45 a.m. UTC | #1
On 23/09/13 18:00, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -EINVAL when virtual vertical size smaller than real
> instead of 0, as done elsewhere in this function. Also remove dup code.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/video/s3fb.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
> index 47ca86c..d838ba8 100644
> --- a/drivers/video/s3fb.c
> +++ b/drivers/video/s3fb.c
> @@ -1336,14 +1336,7 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  			(info->var.bits_per_pixel * info->var.xres_virtual);
>  	if (info->var.yres_virtual < info->var.yres) {
>  		dev_err(info->device, "virtual vertical size smaller than real\n");
> -		goto err_find_mode;
> -	}
> -
> -	/* maximize virtual vertical size for fast scrolling */
> -	info->var.yres_virtual = info->fix.smem_len * 8 /
> -			(info->var.bits_per_pixel * info->var.xres_virtual);
> -	if (info->var.yres_virtual < info->var.yres) {
> -		dev_err(info->device, "virtual vertical size smaller than real\n");
> +		rc = -EINVAL;
>  		goto err_find_mode;
>  	}
>  
> 

Thanks, queuing for 3.12 fixes.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 47ca86c..d838ba8 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -1336,14 +1336,7 @@  static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 			(info->var.bits_per_pixel * info->var.xres_virtual);
 	if (info->var.yres_virtual < info->var.yres) {
 		dev_err(info->device, "virtual vertical size smaller than real\n");
-		goto err_find_mode;
-	}
-
-	/* maximize virtual vertical size for fast scrolling */
-	info->var.yres_virtual = info->fix.smem_len * 8 /
-			(info->var.bits_per_pixel * info->var.xres_virtual);
-	if (info->var.yres_virtual < info->var.yres) {
-		dev_err(info->device, "virtual vertical size smaller than real\n");
+		rc = -EINVAL;
 		goto err_find_mode;
 	}