Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354489
b: refs/heads/master
c: 78110bb
h: refs/heads/master
i:
  354487: 4740aae
v: v3
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Feb 11, 2013
1 parent 0dcdae9 commit 2e5cea1
Show file tree
Hide file tree
Showing 54 changed files with 144 additions and 377 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad463ac42771a0bb8a706cf8a985788fe5f5c1c6
refs/heads/master: 78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b
15 changes: 3 additions & 12 deletions trunk/drivers/staging/asus_oled/asus_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,8 @@ static void enable_oled(struct asus_oled_dev *odev, uint8_t enabl)
struct asus_oled_packet *packet;

packet = kzalloc(sizeof(struct asus_oled_packet), GFP_KERNEL);

if (!packet) {
dev_err(&odev->udev->dev, "out of memory\n");
if (!packet)
return;
}

setup_packet_header(packet, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00);

Expand Down Expand Up @@ -323,11 +320,8 @@ static void send_data(struct asus_oled_dev *odev)
struct asus_oled_packet *packet;

packet = kzalloc(sizeof(struct asus_oled_packet), GFP_KERNEL);

if (!packet) {
dev_err(&odev->udev->dev, "out of memory\n");
if (!packet)
return;
}

if (odev->pack_mode == PACK_MODE_G1) {
/* When sending roll-mode data the display updated only
Expand Down Expand Up @@ -665,11 +659,8 @@ static int asus_oled_probe(struct usb_interface *interface,
}

odev = kzalloc(sizeof(struct asus_oled_dev), GFP_KERNEL);

if (odev == NULL) {
dev_err(&interface->dev, "Out of memory\n");
if (odev == NULL)
return -ENOMEM;
}

odev->udev = usb_get_dev(udev);
odev->pic_mode = ASUS_OLED_STATIC;
Expand Down
14 changes: 4 additions & 10 deletions trunk/drivers/staging/bcm/InterfaceInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ static int usbbcm_device_probe(struct usb_interface *intf, const struct usb_devi
}

/* Allocate interface adapter structure */
psIntfAdapter = kzalloc(sizeof(struct bcm_interface_adapter), GFP_KERNEL);
psIntfAdapter = kzalloc(sizeof(struct bcm_interface_adapter),
GFP_KERNEL);
if (psIntfAdapter == NULL) {
dev_err(&udev->dev, DRV_NAME ": no memory for Interface adapter\n");
AdapterFree(psAdapter);
return -ENOMEM;
}
Expand Down Expand Up @@ -564,11 +564,8 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
psIntfAdapter->sIntrIn.int_in_interval = endpoint->bInterval;
psIntfAdapter->sIntrIn.int_in_buffer =
kmalloc(buffer_size, GFP_KERNEL);
if (!psIntfAdapter->sIntrIn.int_in_buffer) {
dev_err(&psIntfAdapter->udev->dev,
"could not allocate interrupt_in_buffer\n");
if (!psIntfAdapter->sIntrIn.int_in_buffer)
return -EINVAL;
}
}

if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && bcm_usb_endpoint_is_int_out(endpoint)) {
Expand All @@ -587,11 +584,8 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
psIntfAdapter->sIntrOut.int_out_endpointAddr = endpoint->bEndpointAddress;
psIntfAdapter->sIntrOut.int_out_interval = endpoint->bInterval;
psIntfAdapter->sIntrOut.int_out_buffer = kmalloc(buffer_size, GFP_KERNEL);
if (!psIntfAdapter->sIntrOut.int_out_buffer) {
dev_err(&psIntfAdapter->udev->dev,
"could not allocate interrupt_out_buffer\n");
if (!psIntfAdapter->sIntrOut.int_out_buffer)
return -EINVAL;
}
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/staging/ced1401/usb1401.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,10 +1391,8 @@ static int ced_probe(struct usb_interface *interface,

// allocate memory for our device extension and initialize it
pdx = kzalloc(sizeof(*pdx), GFP_KERNEL);
if (!pdx) {
dev_err(&interface->dev, "Out of memory\n");
if (!pdx)
goto error;
}

for (i = 0; i < MAX_TRANSAREAS; ++i) // Initialise the wait queues
{
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,9 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev,
}

async = kzalloc(sizeof(*async), GFP_KERNEL);
if (!async) {
dev_warn(dev->class_dev, "failed to allocate async struct\n");
if (!async)
return -ENOMEM;
}

init_waitqueue_head(&async->wait_head);
async->subdevice = s;
s->async = async;
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/staging/comedi/drivers/amplc_dio200.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,10 +1105,9 @@ dio200_subdev_intr_init(struct comedi_device *dev, struct comedi_subdevice *s,
struct dio200_subdev_intr *subpriv;

subpriv = kzalloc(sizeof(*subpriv), GFP_KERNEL);
if (!subpriv) {
dev_err(dev->class_dev, "error! out of memory!\n");
if (!subpriv)
return -ENOMEM;
}

subpriv->ofs = offset;
subpriv->valid_isns = valid_isns;
spin_lock_init(&subpriv->spinlock);
Expand Down Expand Up @@ -1444,10 +1443,8 @@ dio200_subdev_8254_init(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned int chan;

subpriv = kzalloc(sizeof(*subpriv), GFP_KERNEL);
if (!subpriv) {
dev_err(dev->class_dev, "error! out of memory!\n");
if (!subpriv)
return -ENOMEM;
}

s->private = subpriv;
s->type = COMEDI_SUBD_COUNTER;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/staging/comedi/drivers/comedi_bond.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,9 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
return 0;
}
bdev = kmalloc(sizeof(*bdev), GFP_KERNEL);
if (!bdev) {
dev_err(dev->class_dev, "Out of memory\n");
if (!bdev)
return 0;
}

bdev->dev = d;
bdev->minor = minor;
bdev->subdev = sdev;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/staging/comedi/drivers/dt9812.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,9 @@ static int dt9812_probe(struct usb_interface *interface,

/* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
dev_err(&interface->dev, "Out of memory\n");
if (dev == NULL)
goto error;
}

kref_init(&dev->kref);

dev->udev = usb_get_dev(interface_to_usbdev(interface));
Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/staging/comedi/drivers/ni_labpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,11 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,
return -EINVAL;
} else if (dma_chan) {
/* allocate dma buffer */
devpriv->dma_buffer =
kmalloc(dma_buffer_size, GFP_KERNEL | GFP_DMA);
if (devpriv->dma_buffer == NULL) {
dev_err(dev->class_dev,
"failed to allocate dma buffer\n");
devpriv->dma_buffer = kmalloc(dma_buffer_size,
GFP_KERNEL | GFP_DMA);
if (devpriv->dma_buffer == NULL)
return -ENOMEM;
}

if (request_dma(dma_chan, DRV_NAME)) {
dev_err(dev->class_dev,
"failed to allocate dma channel %u\n",
Expand Down
11 changes: 4 additions & 7 deletions trunk/drivers/staging/comedi/drivers/pcmuio.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,14 +838,11 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)

chans_left = CHANS_PER_ASIC * board->num_asics;
n_subdevs = CALC_N_SUBDEVS(chans_left);
devpriv->sprivs =
kcalloc(n_subdevs, sizeof(struct pcmuio_subdev_private),
GFP_KERNEL);
if (!devpriv->sprivs) {
dev_warn(dev->class_dev,
"cannot allocate subdevice private data structures\n");
devpriv->sprivs = kcalloc(n_subdevs,
sizeof(struct pcmuio_subdev_private),
GFP_KERNEL);
if (!devpriv->sprivs)
return -ENOMEM;
}

ret = comedi_alloc_subdevices(dev, n_subdevs);
if (ret)
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/staging/comedi/drivers/unioxx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,8 @@ static int __unioxx5_subdev_init(struct comedi_subdevice *subdev,
}

usp = kzalloc(sizeof(*usp), GFP_KERNEL);

if (usp == NULL) {
dev_err(subdev->class_dev,
"comedi%d: error! --> out of memory!\n", minor);
if (usp == NULL)
return -1;
}

usp->usp_iobase = subdev_iobase;
dev_info(subdev->class_dev, "comedi%d: |", minor);
Expand Down
27 changes: 4 additions & 23 deletions trunk/drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,44 +2445,34 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
/* create space for the commands of the DA converter */
usbduxsub[index].dac_commands = kzalloc(NUMOUTCHANNELS, GFP_KERNEL);
if (!usbduxsub[index].dac_commands) {
dev_err(dev, "comedi_: usbdux: "
"error alloc space for dac commands\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
}
/* create space for the commands going to the usb device */
usbduxsub[index].dux_commands = kzalloc(SIZEOFDUXBUFFER, GFP_KERNEL);
if (!usbduxsub[index].dux_commands) {
dev_err(dev, "comedi_: usbdux: "
"error alloc space for dux commands\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
}
/* create space for the in buffer and set it to zero */
usbduxsub[index].inBuffer = kzalloc(SIZEINBUF, GFP_KERNEL);
if (!(usbduxsub[index].inBuffer)) {
dev_err(dev, "comedi_: usbdux: "
"could not alloc space for inBuffer\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
}
/* create space of the instruction buffer */
usbduxsub[index].insnBuffer = kzalloc(SIZEINSNBUF, GFP_KERNEL);
if (!(usbduxsub[index].insnBuffer)) {
dev_err(dev, "comedi_: usbdux: "
"could not alloc space for insnBuffer\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
}
/* create space for the outbuffer */
usbduxsub[index].outBuffer = kzalloc(SIZEOUTBUF, GFP_KERNEL);
if (!(usbduxsub[index].outBuffer)) {
dev_err(dev, "comedi_: usbdux: "
"could not alloc space for outBuffer\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand All @@ -2504,10 +2494,9 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
usbduxsub[index].numOfInBuffers = NUMOFINBUFFERSFULL;

usbduxsub[index].urbIn =
kzalloc(sizeof(struct urb *) * usbduxsub[index].numOfInBuffers,
GFP_KERNEL);
kcalloc(usbduxsub[index].numOfInBuffers, sizeof(struct urb *),
GFP_KERNEL);
if (!(usbduxsub[index].urbIn)) {
dev_err(dev, "comedi_: usbdux: Could not alloc. urbIn array\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand All @@ -2532,8 +2521,6 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
usbduxsub[index].urbIn[i]->transfer_buffer =
kzalloc(SIZEINBUF, GFP_KERNEL);
if (!(usbduxsub[index].urbIn[i]->transfer_buffer)) {
dev_err(dev, "comedi_: usbdux%d: "
"could not alloc. transb.\n", index);
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand All @@ -2552,11 +2539,9 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
usbduxsub[index].numOfOutBuffers = NUMOFOUTBUFFERSFULL;

usbduxsub[index].urbOut =
kzalloc(sizeof(struct urb *) * usbduxsub[index].numOfOutBuffers,
GFP_KERNEL);
kcalloc(usbduxsub[index].numOfOutBuffers, sizeof(struct urb *),
GFP_KERNEL);
if (!(usbduxsub[index].urbOut)) {
dev_err(dev, "comedi_: usbdux: "
"Could not alloc. urbOut array\n");
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand All @@ -2581,8 +2566,6 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
usbduxsub[index].urbOut[i]->transfer_buffer =
kzalloc(SIZEOUTBUF, GFP_KERNEL);
if (!(usbduxsub[index].urbOut[i]->transfer_buffer)) {
dev_err(dev, "comedi_: usbdux%d: "
"could not alloc. transb.\n", index);
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand Down Expand Up @@ -2617,8 +2600,6 @@ static int usbdux_usb_probe(struct usb_interface *uinterf,
usbduxsub[index].urbPwm->transfer_buffer =
kzalloc(usbduxsub[index].sizePwmBuf, GFP_KERNEL);
if (!(usbduxsub[index].urbPwm->transfer_buffer)) {
dev_err(dev, "comedi_: usbdux%d: "
"could not alloc. transb. for pwm\n", index);
tidy_up(&(usbduxsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,17 +1556,13 @@ static int usbduxfast_usb_probe(struct usb_interface *uinterf,
usbduxfastsub[index].dux_commands = kmalloc(SIZEOFDUXBUFFER,
GFP_KERNEL);
if (!usbduxfastsub[index].dux_commands) {
dev_err(&uinterf->dev,
"error alloc space for dac commands\n");
tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem);
return -ENOMEM;
}
/* create space of the instruction buffer */
usbduxfastsub[index].insnBuffer = kmalloc(SIZEINSNBUF, GFP_KERNEL);
if (!usbduxfastsub[index].insnBuffer) {
dev_err(&uinterf->dev,
"could not alloc space for insnBuffer\n");
tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand All @@ -1592,8 +1588,6 @@ static int usbduxfast_usb_probe(struct usb_interface *uinterf,
}
usbduxfastsub[index].transfer_buffer = kmalloc(SIZEINBUF, GFP_KERNEL);
if (!usbduxfastsub[index].transfer_buffer) {
dev_err(&uinterf->dev,
"usbduxfast%d: could not alloc. transb.\n", index);
tidy_up(&(usbduxfastsub[index]));
up(&start_stop_sem);
return -ENOMEM;
Expand Down
Loading

0 comments on commit 2e5cea1

Please sign in to comment.