Message ID | Pine.LNX.4.64.1005152315100.21345@ask.diku.dk (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Douglas Landgraf |
Headers | show |
diff -u -p a/drivers/media/video/zoran/videocodec.c b/drivers/media/video/zoran/videocodec.c --- a/drivers/media/video/zoran/videocodec.c +++ b/drivers/media/video/zoran/videocodec.c @@ -107,15 +107,14 @@ videocodec_attach (struct videocodec_mas if (!try_module_get(h->codec->owner)) return NULL; - codec = - kmalloc(sizeof(struct videocodec), GFP_KERNEL); + codec = kmemdup(h->codec, sizeof(struct videocodec), + GFP_KERNEL); if (!codec) { dprintk(1, KERN_ERR "videocodec_attach: no mem\n"); goto out_module_put; } - memcpy(codec, h->codec, sizeof(struct videocodec)); snprintf(codec->name, sizeof(codec->name), "%s[%d]", codec->name, h->attached);