summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/airspy/airspy.c2
-rw-r--r--drivers/media/usb/as102/as102_fw.c2
-rw-r--r--drivers/media/usb/as102/as102_usb_drv.c2
-rw-r--r--drivers/media/usb/au0828/au0828-core.c2
-rw-r--r--drivers/media/usb/au0828/au0828-input.c2
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-cards.c4
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-dvb.c2
-rw-r--r--drivers/media/usb/dvb-usb-v2/dvb_usb_core.c4
-rw-r--r--drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c2
-rw-r--r--drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c2
-rw-r--r--drivers/media/usb/dvb-usb/af9005-fe.c2
-rw-r--r--drivers/media/usb/dvb-usb/cinergyT2-fe.c4
-rw-r--r--drivers/media/usb/dvb-usb/dtt200u-fe.c2
-rw-r--r--drivers/media/usb/dvb-usb/dvb-usb-dvb.c2
-rw-r--r--drivers/media/usb/dvb-usb/dvb-usb-init.c2
-rw-r--r--drivers/media/usb/dvb-usb/vp702x-fe.c3
-rw-r--r--drivers/media/usb/dvb-usb/vp7045-fe.c3
-rw-r--r--drivers/media/usb/em28xx/em28xx-audio.c2
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c4
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c2
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c4
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/usb/go7007/go7007-driver.c2
-rw-r--r--drivers/media/usb/go7007/go7007-usb.c2
-rw-r--r--drivers/media/usb/go7007/s2250-board.c2
-rw-r--r--drivers/media/usb/go7007/snd-go7007.c2
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c4
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c2
-rw-r--r--drivers/media/usb/hackrf/hackrf.c2
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c2
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-video.c4
-rw-r--r--drivers/media/usb/msi2500/msi2500.c2
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-context.c2
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-dvb.c2
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-hdw.c11
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-io.c6
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-ioread.c2
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-sysfs.c8
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c8
-rw-r--r--drivers/media/usb/pwc/pwc-if.c2
-rw-r--r--drivers/media/usb/s2255/s2255drv.c4
-rw-r--r--drivers/media/usb/siano/smsusb.c4
-rw-r--r--drivers/media/usb/stk1160/stk1160-core.c2
-rw-r--r--drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/usb/ttusb-dec/ttusb_dec.c8
-rw-r--r--drivers/media/usb/ttusb-dec/ttusbdecfe.c4
-rw-r--r--drivers/media/usb/usbtv/usbtv-core.c2
-rw-r--r--drivers/media/usb/uvc/uvc_ctrl.c5
-rw-r--r--drivers/media/usb/uvc/uvc_debugfs.c2
-rw-r--r--drivers/media/usb/uvc/uvc_driver.c6
-rw-r--r--drivers/media/usb/uvc/uvc_metadata.c2
-rw-r--r--drivers/media/usb/uvc/uvc_status.c2
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c4
-rw-r--r--drivers/media/usb/uvc/uvc_video.c3
54 files changed, 84 insertions, 87 deletions
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c
index 08f0920cf6ca..1751a67842bc 100644
--- a/drivers/media/usb/airspy/airspy.c
+++ b/drivers/media/usb/airspy/airspy.c
@@ -968,7 +968,7 @@ static int airspy_probe(struct usb_interface *intf,
buf = NULL;
ret = -ENOMEM;
- s = kzalloc(sizeof(struct airspy), GFP_KERNEL);
+ s = kzalloc_obj(struct airspy, GFP_KERNEL);
if (s == NULL) {
dev_err(&intf->dev, "Could not allocate memory for state\n");
return -ENOMEM;
diff --git a/drivers/media/usb/as102/as102_fw.c b/drivers/media/usb/as102/as102_fw.c
index 514764247588..6c14b2754b83 100644
--- a/drivers/media/usb/as102/as102_fw.c
+++ b/drivers/media/usb/as102/as102_fw.c
@@ -96,7 +96,7 @@ static int as102_firmware_upload(struct as10x_bus_adapter_t *bus_adap,
int total_read_bytes = 0, errno = 0;
unsigned char addr_has_changed = 0;
- fw_pkt = kmalloc(sizeof(*fw_pkt), GFP_KERNEL);
+ fw_pkt = kmalloc_obj(*fw_pkt, GFP_KERNEL);
if (!fw_pkt)
return -ENOMEM;
diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c
index e0ef66a522e2..594dde4578ce 100644
--- a/drivers/media/usb/as102/as102_usb_drv.c
+++ b/drivers/media/usb/as102/as102_usb_drv.c
@@ -345,7 +345,7 @@ static int as102_usb_probe(struct usb_interface *intf,
return -EINVAL;
}
- as102_dev = kzalloc(sizeof(struct as102_dev_t), GFP_KERNEL);
+ as102_dev = kzalloc_obj(struct as102_dev_t, GFP_KERNEL);
if (as102_dev == NULL)
return -ENOMEM;
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 1e246b47766d..d99f32d5d06f 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -670,7 +670,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
return -ENODEV;
}
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (dev == NULL) {
pr_err("%s() Unable to allocate memory\n", __func__);
return -ENOMEM;
diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c
index 3d3368202cd0..9de5e7fdbbef 100644
--- a/drivers/media/usb/au0828/au0828-input.c
+++ b/drivers/media/usb/au0828/au0828-input.c
@@ -283,7 +283,7 @@ int au0828_rc_register(struct au0828_dev *dev)
if (!i2c_rc_dev_addr)
return -ENODEV;
- ir = kzalloc(sizeof(*ir), GFP_KERNEL);
+ ir = kzalloc_obj(*ir, GFP_KERNEL);
rc = rc_allocate_device(RC_DRIVER_IR_RAW);
if (!ir || !rc)
goto error;
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 691f073892b3..00029ea23c63 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1295,7 +1295,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
u8 eeprom[256];
struct i2c_client client;
};
- struct eeprom *e = kzalloc(sizeof(*e), GFP_KERNEL);
+ struct eeprom *e = kzalloc_obj(*e, GFP_KERNEL);
if (e == NULL) {
dev_err(dev->dev,
@@ -1381,7 +1381,7 @@ static int cx231xx_media_device_init(struct cx231xx *dev,
#ifdef CONFIG_MEDIA_CONTROLLER
struct media_device *mdev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = kzalloc_obj(*mdev, GFP_KERNEL);
if (!mdev)
return -ENOMEM;
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 0037b4b1381e..913d53abd0e4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -627,7 +627,7 @@ static int dvb_init(struct cx231xx *dev)
return 0;
}
- dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL);
+ dvb = kzalloc_obj(struct cx231xx_dvb, GFP_KERNEL);
if (dvb == NULL) {
dev_info(dev->dev,
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index f1c79f351ec8..acbc951dbdc0 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -392,7 +392,7 @@ static int dvb_usbv2_media_device_init(struct dvb_usb_adapter *adap)
struct dvb_usb_device *d = adap_to_d(adap);
struct usb_device *udev = d->udev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = kzalloc_obj(*mdev, GFP_KERNEL);
if (!mdev)
return -ENOMEM;
@@ -904,7 +904,7 @@ int dvb_usbv2_probe(struct usb_interface *intf,
goto err;
}
- d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL);
+ d = kzalloc_obj(struct dvb_usb_device, GFP_KERNEL);
if (!d) {
dev_err(&udev->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME);
ret = -ENOMEM;
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
index a6ad5f477520..4811f4d1ac87 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
@@ -577,7 +577,7 @@ struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
mxl_dbg("()");
- state = kzalloc(sizeof(struct mxl111sf_demod_state), GFP_KERNEL);
+ state = kzalloc_obj(struct mxl111sf_demod_state, GFP_KERNEL);
if (state == NULL)
return NULL;
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
index 6686f75cbd94..0cc78fd8e916 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
@@ -482,7 +482,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
mxl_dbg("()");
- state = kzalloc(sizeof(struct mxl111sf_tuner_state), GFP_KERNEL);
+ state = kzalloc_obj(struct mxl111sf_tuner_state, GFP_KERNEL);
if (state == NULL)
return NULL;
diff --git a/drivers/media/usb/dvb-usb/af9005-fe.c b/drivers/media/usb/dvb-usb/af9005-fe.c
index 404e56b32145..b6fb72c97aef 100644
--- a/drivers/media/usb/dvb-usb/af9005-fe.c
+++ b/drivers/media/usb/dvb-usb/af9005-fe.c
@@ -1423,7 +1423,7 @@ struct dvb_frontend *af9005_fe_attach(struct dvb_usb_device *d)
struct af9005_fe_state *state = NULL;
/* allocate memory for the internal state */
- state = kzalloc(sizeof(struct af9005_fe_state), GFP_KERNEL);
+ state = kzalloc_obj(struct af9005_fe_state, GFP_KERNEL);
if (state == NULL)
goto error;
diff --git a/drivers/media/usb/dvb-usb/cinergyT2-fe.c b/drivers/media/usb/dvb-usb/cinergyT2-fe.c
index efb207c23a64..84f167a463ce 100644
--- a/drivers/media/usb/dvb-usb/cinergyT2-fe.c
+++ b/drivers/media/usb/dvb-usb/cinergyT2-fe.c
@@ -268,8 +268,8 @@ static const struct dvb_frontend_ops cinergyt2_fe_ops;
struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d)
{
- struct cinergyt2_fe_state *s = kzalloc(sizeof(
- struct cinergyt2_fe_state), GFP_KERNEL);
+ struct cinergyt2_fe_state *s = kzalloc_obj(struct cinergyt2_fe_state,
+ GFP_KERNEL);
if (s == NULL)
return NULL;
diff --git a/drivers/media/usb/dvb-usb/dtt200u-fe.c b/drivers/media/usb/dvb-usb/dtt200u-fe.c
index 586afe22d817..30d2e6d46b5b 100644
--- a/drivers/media/usb/dvb-usb/dtt200u-fe.c
+++ b/drivers/media/usb/dvb-usb/dtt200u-fe.c
@@ -206,7 +206,7 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
struct dtt200u_fe_state* state = NULL;
/* allocate memory for the internal state */
- state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
+ state = kzalloc_obj(struct dtt200u_fe_state, GFP_KERNEL);
if (state == NULL)
goto error;
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index 0a7f8ba90992..94e1e7ce278d 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -103,7 +103,7 @@ static int dvb_usb_media_device_init(struct dvb_usb_adapter *adap)
struct dvb_usb_device *d = adap->dev;
struct usb_device *udev = d->udev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = kzalloc_obj(*mdev, GFP_KERNEL);
if (!mdev)
return -ENOMEM;
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index fbf58012becd..656401276d09 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -278,7 +278,7 @@ int dvb_usb_device_init(struct usb_interface *intf,
if (du != NULL)
*du = NULL;
- d = kzalloc(sizeof(*d), GFP_KERNEL);
+ d = kzalloc_obj(*d, GFP_KERNEL);
if (!d) {
err("no memory for 'struct dvb_usb_device'");
return -ENOMEM;
diff --git a/drivers/media/usb/dvb-usb/vp702x-fe.c b/drivers/media/usb/dvb-usb/vp702x-fe.c
index c1e7931900ee..0f9bd7abbcec 100644
--- a/drivers/media/usb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/usb/dvb-usb/vp702x-fe.c
@@ -323,7 +323,8 @@ static const struct dvb_frontend_ops vp702x_fe_ops;
struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
{
- struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
+ struct vp702x_fe_state *s = kzalloc_obj(struct vp702x_fe_state,
+ GFP_KERNEL);
if (s == NULL)
goto error;
diff --git a/drivers/media/usb/dvb-usb/vp7045-fe.c b/drivers/media/usb/dvb-usb/vp7045-fe.c
index e99740ec2650..a6555fc0b79a 100644
--- a/drivers/media/usb/dvb-usb/vp7045-fe.c
+++ b/drivers/media/usb/dvb-usb/vp7045-fe.c
@@ -140,7 +140,8 @@ static const struct dvb_frontend_ops vp7045_fe_ops;
struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
{
- struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
+ struct vp7045_fe_state *s = kzalloc_obj(struct vp7045_fe_state,
+ GFP_KERNEL);
if (s == NULL)
goto error;
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
index ce1b0d9e0741..ca8432d47301 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -750,7 +750,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
if (!dev->adev.transfer_buffer)
return -ENOMEM;
- dev->adev.urb = kcalloc(num_urb, sizeof(*dev->adev.urb), GFP_KERNEL);
+ dev->adev.urb = kzalloc_objs(*dev->adev.urb, num_urb, GFP_KERNEL);
if (!dev->adev.urb) {
kfree(dev->adev.transfer_buffer);
return -ENOMEM;
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index a51cbcf429e1..2fa43caaa968 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3488,7 +3488,7 @@ static int em28xx_media_device_init(struct em28xx *dev,
#ifdef CONFIG_MEDIA_CONTROLLER
struct media_device *mdev;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = kzalloc_obj(*mdev, GFP_KERNEL);
if (!mdev)
return -ENOMEM;
@@ -3905,7 +3905,7 @@ static int em28xx_usb_probe(struct usb_interface *intf,
}
/* allocate memory for our device state and initialize it */
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (!dev) {
retval = -ENOMEM;
goto err;
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index b94f5c70ab75..c6151d2a21a6 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1500,7 +1500,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
dev_info(&dev->intf->dev, "Binding DVB extension\n");
- dvb = kzalloc(sizeof(*dvb), GFP_KERNEL);
+ dvb = kzalloc_obj(*dvb, GFP_KERNEL);
if (!dvb)
return -ENOMEM;
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 5f3b00869bdb..f8de173affd5 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -724,7 +724,7 @@ static int em28xx_ir_init(struct em28xx *dev)
dev_info(&dev->intf->dev, "Registering input extension\n");
- ir = kzalloc(sizeof(*ir), GFP_KERNEL);
+ ir = kzalloc_obj(*ir, GFP_KERNEL);
if (!ir)
goto ref_put;
rc = rc_allocate_device(RC_DRIVER_SCANCODE);
@@ -765,7 +765,7 @@ static int em28xx_ir_init(struct em28xx *dev)
goto error;
}
- ir->i2c_client = kzalloc(sizeof(*ir->i2c_client), GFP_KERNEL);
+ ir->i2c_client = kzalloc_obj(*ir->i2c_client, GFP_KERNEL);
if (!ir->i2c_client)
goto error;
ir->i2c_client->adapter = &ir->dev->i2c_adap[dev->def_i2c_bus];
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 2dfa3242a7ab..ca88b6b13724 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -2529,7 +2529,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
mutex_lock(&dev->lock);
- v4l2 = kzalloc(sizeof(*v4l2), GFP_KERNEL);
+ v4l2 = kzalloc_obj(*v4l2, GFP_KERNEL);
if (!v4l2) {
mutex_unlock(&dev->lock);
return -ENOMEM;
diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c
index 468406302cd5..77f4d9a249ea 100644
--- a/drivers/media/usb/go7007/go7007-driver.c
+++ b/drivers/media/usb/go7007/go7007-driver.c
@@ -694,7 +694,7 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board,
{
struct go7007 *go;
- go = kzalloc(sizeof(struct go7007), GFP_KERNEL);
+ go = kzalloc_obj(struct go7007, GFP_KERNEL);
if (go == NULL)
return NULL;
go->dev = dev;
diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c
index 334cdde81a5c..8a42aaac9cba 100644
--- a/drivers/media/usb/go7007/go7007-usb.c
+++ b/drivers/media/usb/go7007/go7007-usb.c
@@ -1115,7 +1115,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
if (go == NULL)
return -ENOMEM;
- usb = kzalloc(sizeof(struct go7007_usb), GFP_KERNEL);
+ usb = kzalloc_obj(struct go7007_usb, GFP_KERNEL);
if (usb == NULL) {
kfree(go);
return -ENOMEM;
diff --git a/drivers/media/usb/go7007/s2250-board.c b/drivers/media/usb/go7007/s2250-board.c
index a155b987282f..23f577b0cfbf 100644
--- a/drivers/media/usb/go7007/s2250-board.c
+++ b/drivers/media/usb/go7007/s2250-board.c
@@ -509,7 +509,7 @@ static int s2250_probe(struct i2c_client *client)
if (IS_ERR(audio))
return PTR_ERR(audio);
- state = kzalloc(sizeof(struct s2250), GFP_KERNEL);
+ state = kzalloc_obj(struct s2250, GFP_KERNEL);
if (state == NULL) {
i2c_unregister_device(audio);
return -ENOMEM;
diff --git a/drivers/media/usb/go7007/snd-go7007.c b/drivers/media/usb/go7007/snd-go7007.c
index 9a6bd87fce03..c294c9486611 100644
--- a/drivers/media/usb/go7007/snd-go7007.c
+++ b/drivers/media/usb/go7007/snd-go7007.c
@@ -207,7 +207,7 @@ int go7007_snd_init(struct go7007 *go)
dev++;
return -ENOENT;
}
- gosnd = kmalloc(sizeof(struct go7007_snd), GFP_KERNEL);
+ gosnd = kmalloc_obj(struct go7007_snd, GFP_KERNEL);
if (gosnd == NULL)
return -ENOMEM;
spin_lock_init(&gosnd->lock);
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
index 303b055fefea..ecb73b0b186b 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
@@ -368,7 +368,7 @@ static int hdcs_probe_1x00(struct sd *sd)
sd->gspca_dev.cam.cam_mode = hdcs1x00_mode;
sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode);
- hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL);
+ hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL);
if (!hdcs)
return -ENOMEM;
@@ -425,7 +425,7 @@ static int hdcs_probe_1020(struct sd *sd)
sd->gspca_dev.cam.cam_mode = hdcs1020_mode;
sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode);
- hdcs = kmalloc(sizeof(struct hdcs), GFP_KERNEL);
+ hdcs = kmalloc_obj(struct hdcs, GFP_KERNEL);
if (!hdcs)
return -ENOMEM;
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
index ae382b3b5f7f..984e6283ce83 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
@@ -126,7 +126,7 @@ static int pb0100_init_controls(struct sd *sd)
.def = 1,
};
- ctrls = kzalloc(sizeof(*ctrls), GFP_KERNEL);
+ ctrls = kzalloc_obj(*ctrls, GFP_KERNEL);
if (!ctrls)
return -ENOMEM;
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
index 0b50de8775a3..599ebcad2bcc 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -1348,7 +1348,7 @@ static int hackrf_probe(struct usb_interface *intf,
int ret;
u8 u8tmp, buf[BUF_SIZE];
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto err;
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 52e05a69c46e..eba330e00fb7 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -276,7 +276,7 @@ static int hdpvr_probe(struct usb_interface *interface,
int retval = -ENOMEM;
/* allocate memory for our device state and initialize it */
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (!dev) {
dev_err(&interface->dev, "Out of memory\n");
goto error;
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 8c7ae362d992..54c0484a14d8 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -147,7 +147,7 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
for (i = 0; i < count; i++) {
- buf = kzalloc(sizeof(struct hdpvr_buffer), GFP_KERNEL);
+ buf = kzalloc_obj(struct hdpvr_buffer, GFP_KERNEL);
if (!buf) {
v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n");
goto exit;
@@ -379,7 +379,7 @@ static int hdpvr_stop_streaming(struct hdpvr_device *dev)
static int hdpvr_open(struct file *file)
{
- struct hdpvr_fh *fh = kzalloc(sizeof(*fh), GFP_KERNEL);
+ struct hdpvr_fh *fh = kzalloc_obj(*fh, GFP_KERNEL);
if (fh == NULL)
return -ENOMEM;
diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c
index 33099f39146a..330955ddb703 100644
--- a/drivers/media/usb/msi2500/msi2500.c
+++ b/drivers/media/usb/msi2500/msi2500.c
@@ -1170,7 +1170,7 @@ static int msi2500_probe(struct usb_interface *intf,
.max_speed_hz = 12000000,
};
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto err;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 73c95ba2328a..ca970f7f4bc0 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -204,7 +204,7 @@ struct pvr2_context *pvr2_context_create(
void (*setup_func)(struct pvr2_context *))
{
struct pvr2_context *mp = NULL;
- mp = kzalloc(sizeof(*mp),GFP_KERNEL);
+ mp = kzalloc_obj(*mp, GFP_KERNEL);
if (!mp) goto done;
pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (create)",mp);
mp->setup_func = setup_func;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
index 3610139fb9ad..064c11b7effe 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-dvb.c
@@ -449,7 +449,7 @@ struct pvr2_dvb_adapter *pvr2_dvb_create(struct pvr2_context *pvr)
the DVB side of the driver either. For now. */
return NULL;
}
- adap = kzalloc(sizeof(*adap), GFP_KERNEL);
+ adap = kzalloc_obj(*adap, GFP_KERNEL);
if (!adap) return adap;
pvr2_channel_init(&adap->channel, pvr);
adap->channel.check_func = pvr2_dvb_internal_check;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 5807734ae26c..fe988c6b693f 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -2367,7 +2367,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
goto fail;
}
- hdw = kzalloc(sizeof(*hdw),GFP_KERNEL);
+ hdw = kzalloc_obj(*hdw, GFP_KERNEL);
pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"",
hdw,hdw_desc->description);
pvr2_trace(PVR2_TRACE_INFO, "Hardware description: %s",
@@ -2424,8 +2424,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
hdw->control_cnt = CTRLDEF_COUNT;
hdw->control_cnt += MPEGDEF_COUNT;
- hdw->controls = kcalloc(hdw->control_cnt, sizeof(struct pvr2_ctrl),
- GFP_KERNEL);
+ hdw->controls = kzalloc_objs(struct pvr2_ctrl, hdw->control_cnt,
+ GFP_KERNEL);
if (!hdw->controls) goto fail;
hdw->hdw_desc = hdw_desc;
hdw->ir_scheme_active = hdw->hdw_desc->ir_scheme;
@@ -2450,9 +2450,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
}
/* Define and configure additional controls from cx2341x module. */
- hdw->mpeg_ctrl_info = kcalloc(MPEGDEF_COUNT,
- sizeof(*(hdw->mpeg_ctrl_info)),
- GFP_KERNEL);
+ hdw->mpeg_ctrl_info = kzalloc_objs(*(hdw->mpeg_ctrl_info),
+ MPEGDEF_COUNT, GFP_KERNEL);
if (!hdw->mpeg_ctrl_info) goto fail;
for (idx = 0; idx < MPEGDEF_COUNT; idx++) {
cptr = hdw->controls + idx + CTRLDEF_COUNT;
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-io.c b/drivers/media/usb/pvrusb2/pvrusb2-io.c
index 28ffe7981f8c..1341967ac666 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-io.c
@@ -299,7 +299,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt)
if (scnt > sp->buffer_slot_count) {
struct pvr2_buffer **nb;
- nb = kmalloc_array(scnt, sizeof(*nb), GFP_KERNEL);
+ nb = kmalloc_objs(*nb, scnt, GFP_KERNEL);
if (!nb) return -ENOMEM;
if (sp->buffer_slot_count) {
memcpy(nb, sp->buffers,
@@ -311,7 +311,7 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp, unsigned int cnt)
}
while (sp->buffer_total_count < cnt) {
struct pvr2_buffer *bp;
- bp = kmalloc(sizeof(*bp), GFP_KERNEL);
+ bp = kmalloc_obj(*bp, GFP_KERNEL);
if (!bp) return -ENOMEM;
ret = pvr2_buffer_init(bp, sp, sp->buffer_total_count);
if (ret) {
@@ -460,7 +460,7 @@ static void buffer_complete(struct urb *urb)
struct pvr2_stream *pvr2_stream_create(void)
{
struct pvr2_stream *sp;
- sp = kzalloc(sizeof(*sp), GFP_KERNEL);
+ sp = kzalloc_obj(*sp, GFP_KERNEL);
if (!sp) return sp;
pvr2_trace(PVR2_TRACE_INIT, "pvr2_stream_create: sp=%p", sp);
pvr2_stream_init(sp);
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
index 46f8013849b9..d397231f153d 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
@@ -73,7 +73,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp)
struct pvr2_ioread *pvr2_ioread_create(void)
{
struct pvr2_ioread *cp;
- cp = kzalloc(sizeof(*cp),GFP_KERNEL);
+ cp = kzalloc_obj(*cp, GFP_KERNEL);
if (!cp) return NULL;
pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp);
if (pvr2_ioread_init(cp) < 0) {
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
index 3077399901aa..f2cb644ca3d7 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
@@ -289,7 +289,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id);
if (!cptr) return;
- cip = kzalloc(sizeof(*cip),GFP_KERNEL);
+ cip = kzalloc_obj(*cip, GFP_KERNEL);
if (!cip) return;
pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip);
@@ -411,7 +411,7 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
struct pvr2_sysfs_debugifc *dip;
int ret;
- dip = kzalloc(sizeof(*dip),GFP_KERNEL);
+ dip = kzalloc_obj(*dip, GFP_KERNEL);
if (!dip) return;
sysfs_attr_init(&dip->attr_debugcmd.attr);
dip->attr_debugcmd.attr.name = "debugcmd";
@@ -615,7 +615,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp)
usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw);
if (!usb_dev) return;
- class_dev = kzalloc(sizeof(*class_dev),GFP_KERNEL);
+ class_dev = kzalloc_obj(*class_dev, GFP_KERNEL);
if (!class_dev) return;
pvr2_sysfs_trace("Creating class_dev id=%p",class_dev);
@@ -748,7 +748,7 @@ static void pvr2_sysfs_internal_check(struct pvr2_channel *chp)
void pvr2_sysfs_create(struct pvr2_context *mp)
{
struct pvr2_sysfs *sfp;
- sfp = kzalloc(sizeof(*sfp),GFP_KERNEL);
+ sfp = kzalloc_obj(*sfp, GFP_KERNEL);
if (!sfp)
return;
pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp);
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index f9535a484738..6fd0bfb5f699 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -944,7 +944,7 @@ static int pvr2_v4l2_open(struct file *file)
return -EIO;
}
- fhp = kzalloc(sizeof(*fhp),GFP_KERNEL);
+ fhp = kzalloc_obj(*fhp, GFP_KERNEL);
if (!fhp) {
return -ENOMEM;
}
@@ -1236,7 +1236,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
{
struct pvr2_v4l2 *vp;
- vp = kzalloc(sizeof(*vp),GFP_KERNEL);
+ vp = kzalloc_obj(*vp, GFP_KERNEL);
if (!vp) return vp;
pvr2_channel_init(&vp->channel,mnp);
pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp);
@@ -1244,12 +1244,12 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
vp->channel.check_func = pvr2_v4l2_internal_check;
/* register streams */
- vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL);
+ vp->dev_video = kzalloc_obj(*vp->dev_video, GFP_KERNEL);
if (!vp->dev_video) goto fail;
pvr2_v4l2_dev_init(vp->dev_video,vp,VFL_TYPE_VIDEO);
if (pvr2_hdw_get_input_available(vp->channel.mc_head->hdw) &
(1 << PVR2_CVAL_INPUT_RADIO)) {
- vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
+ vp->dev_radio = kzalloc_obj(*vp->dev_radio, GFP_KERNEL);
if (!vp->dev_radio) goto fail;
pvr2_v4l2_dev_init(vp->dev_radio,vp,VFL_TYPE_RADIO);
}
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index c6e5d031f068..b57502237f3a 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -1026,7 +1026,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
PWC_WARNING("Warning: more than 1 configuration available.\n");
/* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */
- pdev = kzalloc(sizeof(struct pwc_device), GFP_KERNEL);
+ pdev = kzalloc_obj(struct pwc_device, GFP_KERNEL);
if (pdev == NULL) {
PWC_ERROR("Oops, could not allocate memory for pwc_device.\n");
return -ENOMEM;
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 8332f2c5aed7..189a356eaf34 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -2207,7 +2207,7 @@ static int s2255_probe(struct usb_interface *interface,
int fw_size;
/* allocate memory for our device state and initialize it to zero */
- dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL);
+ dev = kzalloc_obj(struct s2255_dev, GFP_KERNEL);
if (dev == NULL) {
s2255_dev_err(&interface->dev, "out of memory\n");
return -ENOMEM;
@@ -2221,7 +2221,7 @@ static int s2255_probe(struct usb_interface *interface,
refcount_set(&dev->num_channels, 0);
dev->pid = id->idProduct;
- dev->fw_data = kzalloc(sizeof(struct s2255_fw), GFP_KERNEL);
+ dev->fw_data = kzalloc_obj(struct s2255_fw, GFP_KERNEL);
if (!dev->fw_data)
goto errorFWDATA1;
mutex_init(&dev->lock);
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 2c8179a84991..4d9cb4184ca2 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -367,7 +367,7 @@ static void *siano_media_device_register(struct smsusb_device_t *dev,
struct sms_board *board = sms_get_board(board_id);
int ret;
- mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+ mdev = kzalloc_obj(*mdev, GFP_KERNEL);
if (!mdev)
return NULL;
@@ -397,7 +397,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
int align = 0;
/* create device object */
- dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
+ dev = kzalloc_obj(struct smsusb_device_t, GFP_KERNEL);
if (!dev)
return -ENOMEM;
diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c
index 25d725c2ab3c..ec4a9e2f42ab 100644
--- a/drivers/media/usb/stk1160/stk1160-core.c
+++ b/drivers/media/usb/stk1160/stk1160-core.c
@@ -295,7 +295,7 @@ static int stk1160_probe(struct usb_interface *interface,
return rc;
}
- dev = kzalloc(sizeof(struct stk1160), GFP_KERNEL);
+ dev = kzalloc_obj(struct stk1160, GFP_KERNEL);
if (dev == NULL) {
kfree(alt_max_pkt_size);
return -ENOMEM;
diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
index 9e016b71aa91..9cd0ea41300c 100644
--- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
@@ -1606,7 +1606,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
- if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
+ if (!(ttusb = kzalloc_obj(struct ttusb, GFP_KERNEL)))
return -ENOMEM;
ttusb->dev = udev;
diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index b4575fe89c95..24ba5c1c48d2 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -809,8 +809,7 @@ static void ttusb_dec_process_urb(struct urb *urb)
b = urb->transfer_buffer + d->offset;
length = d->actual_length;
- if ((frame = kmalloc(sizeof(struct urb_frame),
- GFP_ATOMIC))) {
+ if ((frame = kmalloc_obj(struct urb_frame, GFP_ATOMIC))) {
unsigned long flags;
memcpy(frame->data, b, length);
@@ -1061,8 +1060,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
if (!result) {
if (c_length == 2) {
- if (!(finfo = kmalloc(sizeof(struct filter_info),
- GFP_ATOMIC)))
+ if (!(finfo = kmalloc_obj(struct filter_info, GFP_ATOMIC)))
return -ENOMEM;
finfo->stream_id = c[1];
@@ -1644,7 +1642,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
udev = interface_to_usbdev(intf);
- if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
+ if (!(dec = kzalloc_obj(struct ttusb_dec, GFP_KERNEL))) {
printk("%s: couldn't allocate memory.\n", __func__);
return -ENOMEM;
}
diff --git a/drivers/media/usb/ttusb-dec/ttusbdecfe.c b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
index dff6bf532ce3..df4ade291db4 100644
--- a/drivers/media/usb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/usb/ttusb-dec/ttusbdecfe.c
@@ -198,7 +198,7 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf
struct ttusbdecfe_state* state = NULL;
/* allocate memory for the internal state */
- state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
+ state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL);
if (state == NULL)
return NULL;
@@ -218,7 +218,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
struct ttusbdecfe_state* state = NULL;
/* allocate memory for the internal state */
- state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
+ state = kmalloc_obj(struct ttusbdecfe_state, GFP_KERNEL);
if (state == NULL)
return NULL;
diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
index 1f7620cd2996..12ed28253d0c 100644
--- a/drivers/media/usb/usbtv/usbtv-core.c
+++ b/drivers/media/usb/usbtv/usbtv-core.c
@@ -87,7 +87,7 @@ static int usbtv_probe(struct usb_interface *intf,
size = size * usb_endpoint_maxp_mult(&ep->desc);
/* Device structure */
- usbtv = kzalloc(sizeof(struct usbtv), GFP_KERNEL);
+ usbtv = kzalloc_obj(struct usbtv, GFP_KERNEL);
if (usbtv == NULL)
return -ENOMEM;
usbtv->dev = dev;
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index f0f6f8454d9c..2c511d1d9bf9 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -600,7 +600,7 @@ static const struct uvc_control_mapping *uvc_ctrl_filter_plf_mapping(
u8 init_val;
int ret;
- buf = kmalloc(sizeof(*buf), GFP_KERNEL);
+ buf = kmalloc_obj(*buf, GFP_KERNEL);
if (!buf)
return NULL;
@@ -3339,8 +3339,7 @@ static int uvc_ctrl_init_chain(struct uvc_video_chain *chain)
if (ncontrols == 0)
continue;
- entity->controls = kcalloc(ncontrols, sizeof(*ctrl),
- GFP_KERNEL);
+ entity->controls = kzalloc_objs(*ctrl, ncontrols, GFP_KERNEL);
if (entity->controls == NULL)
return -ENOMEM;
entity->ncontrols = ncontrols;
diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c
index 14fa41cb8148..1ea4a4e82662 100644
--- a/drivers/media/usb/uvc/uvc_debugfs.c
+++ b/drivers/media/usb/uvc/uvc_debugfs.c
@@ -29,7 +29,7 @@ static int uvc_debugfs_stats_open(struct inode *inode, struct file *file)
struct uvc_streaming *stream = inode->i_private;
struct uvc_debugfs_buffer *buf;
- buf = kmalloc(sizeof(*buf), GFP_KERNEL);
+ buf = kmalloc_obj(*buf, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index aa3e8d295e0f..05c5f70c0a93 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -200,7 +200,7 @@ static struct uvc_streaming *uvc_stream_new(struct uvc_device *dev,
{
struct uvc_streaming *stream;
- stream = kzalloc(sizeof(*stream), GFP_KERNEL);
+ stream = kzalloc_obj(*stream, GFP_KERNEL);
if (stream == NULL)
return NULL;
@@ -1761,7 +1761,7 @@ static struct uvc_video_chain *uvc_alloc_chain(struct uvc_device *dev)
{
struct uvc_video_chain *chain;
- chain = kzalloc(sizeof(*chain), GFP_KERNEL);
+ chain = kzalloc_obj(*chain, GFP_KERNEL);
if (chain == NULL)
return NULL;
@@ -2193,7 +2193,7 @@ static int uvc_probe(struct usb_interface *intf,
int ret;
/* Allocate memory for the device and initialize it. */
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev, GFP_KERNEL);
if (dev == NULL)
return -ENOMEM;
diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c
index c23b174965c3..59e2b05aaf21 100644
--- a/drivers/media/usb/uvc/uvc_metadata.c
+++ b/drivers/media/usb/uvc/uvc_metadata.c
@@ -181,7 +181,7 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
* USB requires buffers aligned in a special way, simplest way is to
* make sure that query_ctrl will work is to kmalloc() them.
*/
- data = kmalloc(sizeof(*data), GFP_KERNEL);
+ data = kmalloc_obj(*data, GFP_KERNEL);
if (!data)
return -ENOMEM;
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index 231cfee8e7c2..018d25101bb8 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -263,7 +263,7 @@ int uvc_status_init(struct uvc_device *dev)
if (ep == NULL)
return 0;
- dev->status = kzalloc(sizeof(*dev->status), GFP_KERNEL);
+ dev->status = kzalloc_obj(*dev->status, GFP_KERNEL);
if (!dev->status)
return -ENOMEM;
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 30c160daed8c..98e6c4135dfd 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -133,7 +133,7 @@ static int uvc_ioctl_xu_ctrl_map(struct uvc_video_chain *chain,
return -EINVAL;
}
- map = kzalloc(sizeof(*map), GFP_KERNEL);
+ map = kzalloc_obj(*map, GFP_KERNEL);
if (map == NULL)
return -ENOMEM;
@@ -572,7 +572,7 @@ static int uvc_v4l2_open(struct file *file)
uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
/* Create the device handle. */
- handle = kzalloc(sizeof(*handle), GFP_KERNEL);
+ handle = kzalloc_obj(*handle, GFP_KERNEL);
if (!handle)
return -ENOMEM;
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 59eb95a4b70c..249a225563f9 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -682,8 +682,7 @@ static int uvc_video_clock_init(struct uvc_clock *clock)
spin_lock_init(&clock->lock);
clock->size = 32;
- clock->samples = kmalloc_array(clock->size, sizeof(*clock->samples),
- GFP_KERNEL);
+ clock->samples = kmalloc_objs(*clock->samples, clock->size, GFP_KERNEL);
if (clock->samples == NULL)
return -ENOMEM;