Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/drm Fix copyoutstr usage in d...



details:   https://anonhg.NetBSD.org/src/rev/70ba10ad30db
branches:  riastradh-drm2
changeset: 788590:70ba10ad30db
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jan 15 13:52:30 2014 +0000

description:
Fix copyoutstr usage in drm_version_string.

diffstat:

 sys/external/bsd/drm2/drm/drm_drv.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 9463ab569503 -r 70ba10ad30db sys/external/bsd/drm2/drm/drm_drv.c
--- a/sys/external/bsd/drm2/drm/drm_drv.c       Wed Jan 15 13:52:20 2014 +0000
+++ b/sys/external/bsd/drm2/drm/drm_drv.c       Wed Jan 15 13:52:30 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_drv.c,v 1.1.2.23 2013/09/08 15:34:36 riastradh Exp $       */
+/*     $NetBSD: drm_drv.c,v 1.1.2.24 2014/01/15 13:52:30 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.23 2013/09/08 15:34:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.1.2.24 2014/01/15 13:52:30 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -677,7 +677,9 @@
 
        *lenp = len;
        if ((trunc_len > 0) && (target != NULL))
-               return copyoutstr(source, target, trunc_len, NULL);
+               /* copyoutstr takes a buffer size, not a string length.  */
+               /* XXX errno NetBSD->Linux */
+               return -copyoutstr(source, target, trunc_len+1, NULL);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index