Re: [PATCH] (1/22) lvalues abuse in dmasound

From: Roman Zippel (zippel_at_linux-m68k.org)
Date: 08/25/05

  • Next message: Christoph Hellwig: "Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t"
    Date:	Thu, 25 Aug 2005 11:04:29 +0200 (CEST)
    To: Al Viro <viro@www.linux.org.uk>
    
    

    Hi,

    On Thu, 25 Aug 2005, Al Viro wrote:

    > diff -urN RC13-rc7/sound/oss/dmasound/dmasound_paula.c RC13-rc7-dmasound-lvalues/sound/oss/dmasound/dmasound_paula.c
    > --- RC13-rc7/sound/oss/dmasound/dmasound_paula.c 2005-06-17 15:48:29.000000000 -0400
    > +++ RC13-rc7-dmasound-lvalues/sound/oss/dmasound/dmasound_paula.c 2005-08-25 00:54:04.000000000 -0400
    > @@ -253,8 +253,9 @@
    > count = min_t(size_t, userCount, frameLeft)>>1 & ~1; \
    > used = count*2; \
    > while (count > 0) { \
    > - if (get_user(data, ((u_short *)userPtr)++)) \
    > + if (get_user(data, (u_short *)userPtr)) \
    > return -EFAULT; \
    > + userPtr += 2; \
    > data = convsample(data); \
    > *high++ = data>>8; \
    > *low++ = (data>>2) & 0x3f; \
    > @@ -268,13 +269,15 @@
    > count = min_t(size_t, userCount, frameLeft)>>2 & ~1; \
    > used = count*4; \
    > while (count > 0) { \
    > - if (get_user(data, ((u_short *)userPtr)++)) \
    > + if (get_user(data, (u_short *)userPtr)) \
    > return -EFAULT; \
    > + userPtr += 2; \
    > data = convsample(data); \
    > *lefth++ = data>>8; \
    > *leftl++ = (data>>2) & 0x3f; \
    > - if (get_user(data, ((u_short *)userPtr)++)) \
    > + if (get_user(data, (u_short *)userPtr)) \
    > return -EFAULT; \
    > + userPtr += 2; \
    > data = convsample(data); \
    > *righth++ = data>>8; \
    > *rightl++ = (data>>2) & 0x3f; \

    Please replace this with the patch from CVS:

    Index: sound/oss/dmasound/dmasound_paula.c
    ===================================================================
    RCS file: /home/linux-m68k/cvsroot/linux/sound/oss/dmasound/dmasound_paula.c,v
    retrieving revision 1.1.1.7
    retrieving revision 1.6
    diff -u -p -r1.1.1.7 -r1.6
    --- sound/oss/dmasound/dmasound_paula.c 15 Aug 2004 14:21:28 -0000 1.1.1.7
    +++ sound/oss/dmasound/dmasound_paula.c 29 May 2005 18:01:55 -0000 1.6
    @@ -244,6 +244,7 @@ static ssize_t funcname(const u_char *us
                             u_char frame[], ssize_t *frameUsed, \
                             ssize_t frameLeft) \
     { \
    + const u_short *ptr = (const u_short *)userPtr; \
             ssize_t count, used; \
             u_short data; \
                                                                             \
    @@ -253,7 +254,7 @@ static ssize_t funcname(const u_char *us
                     count = min_t(size_t, userCount, frameLeft)>>1 & ~1; \
                     used = count*2; \
                     while (count > 0) { \
    - if (get_user(data, ((u_short *)userPtr)++)) \
    + if (get_user(data, ptr++)) \
                                     return -EFAULT; \
                             data = convsample(data); \
                             *high++ = data>>8; \
    @@ -268,12 +269,12 @@ static ssize_t funcname(const u_char *us
                     count = min_t(size_t, userCount, frameLeft)>>2 & ~1; \
                     used = count*4; \
                     while (count > 0) { \
    - if (get_user(data, ((u_short *)userPtr)++)) \
    + if (get_user(data, ptr++)) \
                                     return -EFAULT; \
                             data = convsample(data); \
                             *lefth++ = data>>8; \
                             *leftl++ = (data>>2) & 0x3f; \
    - if (get_user(data, ((u_short *)userPtr)++)) \
    + if (get_user(data, ptr++)) \
                                     return -EFAULT; \
                             data = convsample(data); \
                             *righth++ = data>>8; \

    bye, Roman
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Christoph Hellwig: "Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t"

    Relevant Pages

    • Re: ATA issues: ad0: FAILURE - ATA_IDENTIFY no interrupt
      ... repo is a local mirror of the other local mirror), ... I am able to boot today's kernel in single-user mode, ... Reviewong the log from "cvs update," I see that there were updates ... I do not "unsubscribe" from email "services" to which I have not explicitly ...
      (freebsd-current)
    • Re: buildworld error (CVS july 4)
      ... retrieving revision 1.23.2.7 ... * compact the IP header into a structure which contains just the info. ... diff -u -r1.25.2.7 ip_fil.c ... I do not "unsubscribe" from email "services" to which I have not explicitly ...
      (freebsd-stable)
    • Exim mail aliases question
      ... rok: rok@localhost ... roman: roman@localhost ... sales: oleg.bodnar@localhost, roman@localhost, rok@localhost, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
      (Debian-User)
    • Re: madwifi quite unusable for several kernel versions
      ... *> I have severe problems with the madwifi driver (CVS version as of Apr ... *> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list ...
      (Fedora)
    • [Fwd: RFC.. defining __rangeof() in cdefs.h]
      ... retrieving revision 1.83 ... diff -u -r1.83 cdefs.h ... * Compiler-dependent macros to declare that functions take printf-like ... To unsubscribe, ...
      (freebsd-current)