Skip to content

Commit

Permalink
staging: comedi: unionxx5: allocate 'usp' before using it
Browse files Browse the repository at this point in the history
As reported by the kbuild test robot, the 'usp' pointer needs to be
allocated before being used.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 12, 2013
1 parent 5351035 commit dd671a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/comedi/drivers/unioxx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,15 @@ static int __unioxx5_subdev_init(struct comedi_device *dev,
int i, to, ndef_flag = 0;
int ret;

usp = kzalloc(sizeof(*usp), GFP_KERNEL);
if (usp == NULL)
return -ENOMEM;

ret = __comedi_request_region(dev, iobase, UNIOXX5_SIZE);
if (ret)
return ret;
usp->usp_iobase = iobase;

usp = kzalloc(sizeof(*usp), GFP_KERNEL);
if (usp == NULL)
return -ENOMEM;

/* defining modules types */
for (i = 0; i < 12; i++) {
to = 10000;
Expand Down

0 comments on commit dd671a3

Please sign in to comment.