patch-2.4.0-test8 linux/drivers/video/atyfb.c

Next file: linux/drivers/video/cgfourteenfb.c
Previous file: linux/drivers/usb/uss720.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test7/linux/drivers/video/atyfb.c linux/drivers/video/atyfb.c
@@ -1,4 +1,4 @@
-/*  $Id: atyfb.c,v 1.146 2000/07/26 23:02:51 davem Exp $
+/*  $Id: atyfb.c,v 1.147 2000/08/29 07:01:56 davem Exp $
  *  linux/drivers/video/atyfb.c -- Frame buffer device for ATI Mach64
  *
  *	Copyright (C) 1997-1998  Geert Uytterhoeven
@@ -3010,7 +3010,8 @@
 	fbtyp.fb_depth = info->current_par.crtc.bpp;
 	fbtyp.fb_cmsize = disp->cmap.len;
 	fbtyp.fb_size = info->total_vram;
-	copy_to_user_ret((struct fbtype *)arg, &fbtyp, sizeof(fbtyp), -EFAULT);
+	if (copy_to_user((struct fbtype *)arg, &fbtyp, sizeof(fbtyp)))
+		return -EFAULT;
 	break;
 #endif /* __sparc__ */
 #ifdef DEBUG
@@ -3031,8 +3032,8 @@
 	    clk.dsp_precision = (dsp_config>>20) & 7;
 	    clk.dsp_on = dsp_on_off & 0x7ff;
 	    clk.dsp_off = (dsp_on_off>>16) & 0x7ff;
-	    copy_to_user_ret((struct atyclk *)arg, &clk, sizeof(clk),
-			     -EFAULT);
+	    if (copy_to_user((struct atyclk *)arg, &clk, sizeof(clk)))
+		    return -EFAULT;
 	} else
 	    return -EINVAL;
 	break;
@@ -3040,8 +3041,8 @@
 	if ((Gx != GX_CHIP_ID) && (Gx != CX_CHIP_ID)) {
 	    struct atyclk clk;
 	    struct pll_ct *pll = &info->current_par.pll.ct;
-	    copy_from_user_ret(&clk, (struct atyclk *)arg, sizeof(clk),
-			       -EFAULT);
+	    if (copy_from_user(&clk, (struct atyclk *)arg, sizeof(clk)))
+		    return -EFAULT;
 	    info->ref_clk_per = clk.ref_clk_per;
 	    pll->pll_ref_div = clk.pll_ref_div;
 	    pll->mclk_fb_div = clk.mclk_fb_div;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)