From: H Hartley Sweeten Date: Wed, 27 Jun 2012 01:03:34 +0000 (-0700) Subject: staging: comedi: cb_pcidas: check for failure of subdev_8255_init X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4f0036ef09387a49b709d9b319ad93492e53d790;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git staging: comedi: cb_pcidas: check for failure of subdev_8255_init It's possible for subdev_8255_init() to fail due to its kzalloc(). Make sure to check for this failure and pass on the error code. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index 9379d2517702..a0330714dd55 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -1640,7 +1640,10 @@ static int cb_pcidas_attach(struct comedi_device *dev, /* 8255 */ s = dev->subdevices + 2; - subdev_8255_init(dev, s, NULL, devpriv->pacer_counter_dio + DIO_8255); + ret = subdev_8255_init(dev, s, NULL, + devpriv->pacer_counter_dio + DIO_8255); + if (ret) + return ret; /* serial EEPROM, */ s = dev->subdevices + 3;