staging: comedi: ni_660x: allocate counters early in (*auto_attach)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:45 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
commitf229594a327720c0761e7307a5472aea780268c3
treef9bdb4f7f13edb694fd2c8b1dcf584305ddd9569
parent2363cbf073225537016aceb6bf122bbee6a0caa0
staging: comedi: ni_660x: allocate counters early in (*auto_attach)

The ni_gpct_device_construct() could fail allocating the memory for
device and its counters. For aesthetics, call the function before
initializing the subdevices.

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