]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: s626: don't dereference insn->data
authorIan Abbott <abbotti@mev.co.uk>
Mon, 24 Sep 2012 16:20:52 +0000 (17:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 17:45:38 +0000 (10:45 -0700)
`s626_enc_insn_config()` is incorrectly dereferencing `insn->data` which
is a pointer to user memory.  It should be dereferencing the separate
`data` parameter that points to a copy of the data in kernel memory.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/s626.c

index e1d10f366c2fccd91767fc23de8d7cd321c682e8..430e26b9e344bf2a113017896be1138d4b90a019 100644 (file)
@@ -1825,7 +1825,7 @@ static int s626_enc_insn_config(struct comedi_device *dev,
        /*   (data==NULL) ? (Preloadvalue=0) : (Preloadvalue=data[0]); */
 
        k->SetMode(dev, k, Setup, TRUE);
-       Preload(dev, k, *(insn->data));
+       Preload(dev, k, data[0]);
        k->PulseIndex(dev, k);
        SetLatchSource(dev, k, valueSrclatch);
        k->SetEnable(dev, k, (uint16_t) (enab != 0));