diff options
author | Mike Isely <isely@pobox.com> | 2007-01-19 22:37:11 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:41 -0500 |
commit | ca545f7c39476c6c4c6e639452180a2b38342669 (patch) | |
tree | e9751274759bcdf51bff577f55a030d4f23dca90 /drivers/media/video/pvrusb2 | |
parent | eca8ebfc11d1935a7dd4c59cb8defb5bdff44ecd (diff) |
V4L/DVB (5091): Pvrusb2: Use kzalloc in place of kmalloc/memset pairs
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-audio.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-context.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 14 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-io.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-ioread.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-std.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 15 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-tuner.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 3 | ||||
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 3 |
12 files changed, 19 insertions, 40 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c index 5d30c9366144..7e61d4a17846 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c | |||
@@ -152,9 +152,8 @@ int pvr2_i2c_msp3400_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
152 | struct pvr2_msp3400_handler *ctxt; | 152 | struct pvr2_msp3400_handler *ctxt; |
153 | if (cp->handler) return 0; | 153 | if (cp->handler) return 0; |
154 | 154 | ||
155 | ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); | 155 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); |
156 | if (!ctxt) return 0; | 156 | if (!ctxt) return 0; |
157 | memset(ctxt,0,sizeof(*ctxt)); | ||
158 | 157 | ||
159 | ctxt->i2c_handler.func_data = ctxt; | 158 | ctxt->i2c_handler.func_data = ctxt; |
160 | ctxt->i2c_handler.func_table = &msp3400_funcs; | 159 | ctxt->i2c_handler.func_table = &msp3400_funcs; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.c b/drivers/media/video/pvrusb2/pvrusb2-context.c index cf129746205d..6bbed88d7867 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/drivers/media/video/pvrusb2/pvrusb2-context.c | |||
@@ -83,9 +83,8 @@ struct pvr2_context *pvr2_context_create( | |||
83 | void (*setup_func)(struct pvr2_context *)) | 83 | void (*setup_func)(struct pvr2_context *)) |
84 | { | 84 | { |
85 | struct pvr2_context *mp = NULL; | 85 | struct pvr2_context *mp = NULL; |
86 | mp = kmalloc(sizeof(*mp),GFP_KERNEL); | 86 | mp = kzalloc(sizeof(*mp),GFP_KERNEL); |
87 | if (!mp) goto done; | 87 | if (!mp) goto done; |
88 | memset(mp,0,sizeof(*mp)); | ||
89 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_main id=%p",mp); | 88 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_main id=%p",mp); |
90 | mp->setup_func = setup_func; | 89 | mp->setup_func = setup_func; |
91 | mutex_init(&mp->mutex); | 90 | mutex_init(&mp->mutex); |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c index a3357bf2a1af..851099a85e5a 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | |||
@@ -231,9 +231,8 @@ int pvr2_i2c_cx2584x_v4l_setup(struct pvr2_hdw *hdw, | |||
231 | if (cp->handler) return 0; | 231 | if (cp->handler) return 0; |
232 | if (!decoder_detect(cp)) return 0; | 232 | if (!decoder_detect(cp)) return 0; |
233 | 233 | ||
234 | ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); | 234 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); |
235 | if (!ctxt) return 0; | 235 | if (!ctxt) return 0; |
236 | memset(ctxt,0,sizeof(*ctxt)); | ||
237 | 236 | ||
238 | ctxt->handler.func_data = ctxt; | 237 | ctxt->handler.func_data = ctxt; |
239 | ctxt->handler.func_table = &hfuncs; | 238 | ctxt->handler.func_table = &hfuncs; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 1c79ce1e16c4..7f9168538245 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1934,20 +1934,18 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1934 | return NULL; | 1934 | return NULL; |
1935 | } | 1935 | } |
1936 | 1936 | ||
1937 | hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); | 1937 | hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); |
1938 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", | 1938 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", |
1939 | hdw,pvr2_device_names[hdw_type]); | 1939 | hdw,pvr2_device_names[hdw_type]); |
1940 | if (!hdw) goto fail; | 1940 | if (!hdw) goto fail; |
1941 | memset(hdw,0,sizeof(*hdw)); | ||
1942 | hdw->tuner_signal_stale = !0; | 1941 | hdw->tuner_signal_stale = !0; |
1943 | cx2341x_fill_defaults(&hdw->enc_ctl_state); | 1942 | cx2341x_fill_defaults(&hdw->enc_ctl_state); |
1944 | 1943 | ||
1945 | hdw->control_cnt = CTRLDEF_COUNT; | 1944 | hdw->control_cnt = CTRLDEF_COUNT; |
1946 | hdw->control_cnt += MPEGDEF_COUNT; | 1945 | hdw->control_cnt += MPEGDEF_COUNT; |
1947 | hdw->controls = kmalloc(sizeof(struct pvr2_ctrl) * hdw->control_cnt, | 1946 | hdw->controls = kzalloc(sizeof(struct pvr2_ctrl) * hdw->control_cnt, |
1948 | GFP_KERNEL); | 1947 | GFP_KERNEL); |
1949 | if (!hdw->controls) goto fail; | 1948 | if (!hdw->controls) goto fail; |
1950 | memset(hdw->controls,0,sizeof(struct pvr2_ctrl) * hdw->control_cnt); | ||
1951 | hdw->hdw_type = hdw_type; | 1949 | hdw->hdw_type = hdw_type; |
1952 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 1950 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
1953 | cptr = hdw->controls + idx; | 1951 | cptr = hdw->controls + idx; |
@@ -1961,11 +1959,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1961 | cptr->info = control_defs+idx; | 1959 | cptr->info = control_defs+idx; |
1962 | } | 1960 | } |
1963 | /* Define and configure additional controls from cx2341x module. */ | 1961 | /* Define and configure additional controls from cx2341x module. */ |
1964 | hdw->mpeg_ctrl_info = kmalloc( | 1962 | hdw->mpeg_ctrl_info = kzalloc( |
1965 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL); | 1963 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL); |
1966 | if (!hdw->mpeg_ctrl_info) goto fail; | 1964 | if (!hdw->mpeg_ctrl_info) goto fail; |
1967 | memset(hdw->mpeg_ctrl_info,0, | ||
1968 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT); | ||
1969 | for (idx = 0; idx < MPEGDEF_COUNT; idx++) { | 1965 | for (idx = 0; idx < MPEGDEF_COUNT; idx++) { |
1970 | cptr = hdw->controls + idx + CTRLDEF_COUNT; | 1966 | cptr = hdw->controls + idx + CTRLDEF_COUNT; |
1971 | ciptr = &(hdw->mpeg_ctrl_info[idx].info); | 1967 | ciptr = &(hdw->mpeg_ctrl_info[idx].info); |
@@ -2608,14 +2604,12 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) | |||
2608 | pvr2_trace(PVR2_TRACE_FIRMWARE, | 2604 | pvr2_trace(PVR2_TRACE_FIRMWARE, |
2609 | "Preparing to suck out CPU firmware"); | 2605 | "Preparing to suck out CPU firmware"); |
2610 | hdw->fw_size = 0x2000; | 2606 | hdw->fw_size = 0x2000; |
2611 | hdw->fw_buffer = kmalloc(hdw->fw_size,GFP_KERNEL); | 2607 | hdw->fw_buffer = kzalloc(hdw->fw_size,GFP_KERNEL); |
2612 | if (!hdw->fw_buffer) { | 2608 | if (!hdw->fw_buffer) { |
2613 | hdw->fw_size = 0; | 2609 | hdw->fw_size = 0; |
2614 | break; | 2610 | break; |
2615 | } | 2611 | } |
2616 | 2612 | ||
2617 | memset(hdw->fw_buffer,0,hdw->fw_size); | ||
2618 | |||
2619 | /* We have to hold the CPU during firmware upload. */ | 2613 | /* We have to hold the CPU during firmware upload. */ |
2620 | pvr2_hdw_cpureset_assert(hdw,1); | 2614 | pvr2_hdw_cpureset_assert(hdw,1); |
2621 | 2615 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index a28299107be7..223a571faff3 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | |||
@@ -897,12 +897,11 @@ static int pvr2_i2c_attach_inform(struct i2c_client *client) | |||
897 | struct pvr2_hdw *hdw = (struct pvr2_hdw *)(client->adapter->algo_data); | 897 | struct pvr2_hdw *hdw = (struct pvr2_hdw *)(client->adapter->algo_data); |
898 | struct pvr2_i2c_client *cp; | 898 | struct pvr2_i2c_client *cp; |
899 | int fl = !(hdw->i2c_pend_types & PVR2_I2C_PEND_ALL); | 899 | int fl = !(hdw->i2c_pend_types & PVR2_I2C_PEND_ALL); |
900 | cp = kmalloc(sizeof(*cp),GFP_KERNEL); | 900 | cp = kzalloc(sizeof(*cp),GFP_KERNEL); |
901 | trace_i2c("i2c_attach [client=%s @ 0x%x ctxt=%p]", | 901 | trace_i2c("i2c_attach [client=%s @ 0x%x ctxt=%p]", |
902 | client->name, | 902 | client->name, |
903 | client->addr,cp); | 903 | client->addr,cp); |
904 | if (!cp) return -ENOMEM; | 904 | if (!cp) return -ENOMEM; |
905 | memset(cp,0,sizeof(*cp)); | ||
906 | cp->hdw = hdw; | 905 | cp->hdw = hdw; |
907 | INIT_LIST_HEAD(&cp->list); | 906 | INIT_LIST_HEAD(&cp->list); |
908 | cp->client = client; | 907 | cp->client = client; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c index 57fb32033543..ce3c8982ffe0 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/drivers/media/video/pvrusb2/pvrusb2-io.c | |||
@@ -474,9 +474,8 @@ static void buffer_complete(struct urb *urb) | |||
474 | struct pvr2_stream *pvr2_stream_create(void) | 474 | struct pvr2_stream *pvr2_stream_create(void) |
475 | { | 475 | { |
476 | struct pvr2_stream *sp; | 476 | struct pvr2_stream *sp; |
477 | sp = kmalloc(sizeof(*sp),GFP_KERNEL); | 477 | sp = kzalloc(sizeof(*sp),GFP_KERNEL); |
478 | if (!sp) return sp; | 478 | if (!sp) return sp; |
479 | memset(sp,0,sizeof(*sp)); | ||
480 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_stream_create: sp=%p",sp); | 479 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_stream_create: sp=%p",sp); |
481 | pvr2_stream_init(sp); | 480 | pvr2_stream_init(sp); |
482 | return sp; | 481 | return sp; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c index b71f9a961f8a..f782418afa45 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c | |||
@@ -87,10 +87,9 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) | |||
87 | struct pvr2_ioread *pvr2_ioread_create(void) | 87 | struct pvr2_ioread *pvr2_ioread_create(void) |
88 | { | 88 | { |
89 | struct pvr2_ioread *cp; | 89 | struct pvr2_ioread *cp; |
90 | cp = kmalloc(sizeof(*cp),GFP_KERNEL); | 90 | cp = kzalloc(sizeof(*cp),GFP_KERNEL); |
91 | if (!cp) return NULL; | 91 | if (!cp) return NULL; |
92 | pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); | 92 | pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); |
93 | memset(cp,0,sizeof(*cp)); | ||
94 | if (pvr2_ioread_init(cp) < 0) { | 93 | if (pvr2_ioread_init(cp) < 0) { |
95 | kfree(cp); | 94 | kfree(cp); |
96 | return NULL; | 95 | return NULL; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c index 30cceef0b169..81de26ba41d9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-std.c +++ b/drivers/media/video/pvrusb2/pvrusb2-std.c | |||
@@ -359,9 +359,8 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, | |||
359 | std_cnt); | 359 | std_cnt); |
360 | if (!std_cnt) return NULL; // paranoia | 360 | if (!std_cnt) return NULL; // paranoia |
361 | 361 | ||
362 | stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt, | 362 | stddefs = kzalloc(sizeof(struct v4l2_standard) * std_cnt, |
363 | GFP_KERNEL); | 363 | GFP_KERNEL); |
364 | memset(stddefs,0,sizeof(struct v4l2_standard) * std_cnt); | ||
365 | for (idx = 0; idx < std_cnt; idx++) stddefs[idx].index = idx; | 364 | for (idx = 0; idx < std_cnt; idx++) stddefs[idx].index = idx; |
366 | 365 | ||
367 | idx = 0; | 366 | idx = 0; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 2f6568e7e6f2..91396fd573e4 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -501,9 +501,8 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) | |||
501 | cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); | 501 | cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); |
502 | if (!cptr) return; | 502 | if (!cptr) return; |
503 | 503 | ||
504 | cip = kmalloc(sizeof(*cip),GFP_KERNEL); | 504 | cip = kzalloc(sizeof(*cip),GFP_KERNEL); |
505 | if (!cip) return; | 505 | if (!cip) return; |
506 | memset(cip,0,sizeof(*cip)); | ||
507 | pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); | 506 | pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); |
508 | 507 | ||
509 | cip->cptr = cptr; | 508 | cip->cptr = cptr; |
@@ -613,9 +612,8 @@ static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp) | |||
613 | struct pvr2_sysfs_debugifc *dip; | 612 | struct pvr2_sysfs_debugifc *dip; |
614 | int ret; | 613 | int ret; |
615 | 614 | ||
616 | dip = kmalloc(sizeof(*dip),GFP_KERNEL); | 615 | dip = kzalloc(sizeof(*dip),GFP_KERNEL); |
617 | if (!dip) return; | 616 | if (!dip) return; |
618 | memset(dip,0,sizeof(*dip)); | ||
619 | dip->attr_debugcmd.attr.owner = THIS_MODULE; | 617 | dip->attr_debugcmd.attr.owner = THIS_MODULE; |
620 | dip->attr_debugcmd.attr.name = "debugcmd"; | 618 | dip->attr_debugcmd.attr.name = "debugcmd"; |
621 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; | 619 | dip->attr_debugcmd.attr.mode = S_IRUGO|S_IWUSR|S_IWGRP; |
@@ -768,9 +766,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
768 | 766 | ||
769 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); | 767 | usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw); |
770 | if (!usb_dev) return; | 768 | if (!usb_dev) return; |
771 | class_dev = kmalloc(sizeof(*class_dev),GFP_KERNEL); | 769 | class_dev = kzalloc(sizeof(*class_dev),GFP_KERNEL); |
772 | if (!class_dev) return; | 770 | if (!class_dev) return; |
773 | memset(class_dev,0,sizeof(*class_dev)); | ||
774 | 771 | ||
775 | pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); | 772 | pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); |
776 | 773 | ||
@@ -862,9 +859,8 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, | |||
862 | struct pvr2_sysfs_class *class_ptr) | 859 | struct pvr2_sysfs_class *class_ptr) |
863 | { | 860 | { |
864 | struct pvr2_sysfs *sfp; | 861 | struct pvr2_sysfs *sfp; |
865 | sfp = kmalloc(sizeof(*sfp),GFP_KERNEL); | 862 | sfp = kzalloc(sizeof(*sfp),GFP_KERNEL); |
866 | if (!sfp) return sfp; | 863 | if (!sfp) return sfp; |
867 | memset(sfp,0,sizeof(*sfp)); | ||
868 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); | 864 | pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp); |
869 | pvr2_channel_init(&sfp->channel,mp); | 865 | pvr2_channel_init(&sfp->channel,mp); |
870 | sfp->channel.check_func = pvr2_sysfs_internal_check; | 866 | sfp->channel.check_func = pvr2_sysfs_internal_check; |
@@ -885,9 +881,8 @@ static int pvr2_sysfs_hotplug(struct class_device *cd,char **envp, | |||
885 | struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) | 881 | struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) |
886 | { | 882 | { |
887 | struct pvr2_sysfs_class *clp; | 883 | struct pvr2_sysfs_class *clp; |
888 | clp = kmalloc(sizeof(*clp),GFP_KERNEL); | 884 | clp = kzalloc(sizeof(*clp),GFP_KERNEL); |
889 | if (!clp) return clp; | 885 | if (!clp) return clp; |
890 | memset(clp,0,sizeof(*clp)); | ||
891 | pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp); | 886 | pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp); |
892 | clp->class.name = "pvrusb2"; | 887 | clp->class.name = "pvrusb2"; |
893 | clp->class.class_release = pvr2_sysfs_class_release; | 888 | clp->class.class_release = pvr2_sysfs_class_release; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-tuner.c b/drivers/media/video/pvrusb2/pvrusb2-tuner.c index bb17db3f6434..05e65ce2e3a9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-tuner.c +++ b/drivers/media/video/pvrusb2/pvrusb2-tuner.c | |||
@@ -93,9 +93,8 @@ int pvr2_i2c_tuner_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
93 | struct pvr2_tuner_handler *ctxt; | 93 | struct pvr2_tuner_handler *ctxt; |
94 | if (cp->handler) return 0; | 94 | if (cp->handler) return 0; |
95 | 95 | ||
96 | ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); | 96 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); |
97 | if (!ctxt) return 0; | 97 | if (!ctxt) return 0; |
98 | memset(ctxt,0,sizeof(*ctxt)); | ||
99 | 98 | ||
100 | ctxt->i2c_handler.func_data = ctxt; | 99 | ctxt->i2c_handler.func_data = ctxt; |
101 | ctxt->i2c_handler.func_table = &tuner_funcs; | 100 | ctxt->i2c_handler.func_table = &tuner_funcs; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index 7f42042c2016..61efa6f02200 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | |||
@@ -206,9 +206,8 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *hdw, | |||
206 | if (cp->handler) return 0; | 206 | if (cp->handler) return 0; |
207 | if (!decoder_detect(cp)) return 0; | 207 | if (!decoder_detect(cp)) return 0; |
208 | 208 | ||
209 | ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); | 209 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); |
210 | if (!ctxt) return 0; | 210 | if (!ctxt) return 0; |
211 | memset(ctxt,0,sizeof(*ctxt)); | ||
212 | 211 | ||
213 | ctxt->handler.func_data = ctxt; | 212 | ctxt->handler.func_data = ctxt; |
214 | ctxt->handler.func_table = &hfuncs; | 213 | ctxt->handler.func_table = &hfuncs; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index 234adf7aa614..66b4d36ef765 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c | |||
@@ -144,9 +144,8 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
144 | 144 | ||
145 | if (cp->handler) return 0; | 145 | if (cp->handler) return 0; |
146 | 146 | ||
147 | ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); | 147 | ctxt = kzalloc(sizeof(*ctxt),GFP_KERNEL); |
148 | if (!ctxt) return 0; | 148 | if (!ctxt) return 0; |
149 | memset(ctxt,0,sizeof(*ctxt)); | ||
150 | 149 | ||
151 | ctxt->handler.func_data = ctxt; | 150 | ctxt->handler.func_data = ctxt; |
152 | ctxt->handler.func_table = &hfuncs; | 151 | ctxt->handler.func_table = &hfuncs; |