Skip to content

Commit

Permalink
[media] cx18/ivtv: fix regression: remove __init from a non-init func…
Browse files Browse the repository at this point in the history
…tion

Commits 5e6e81b (cx18) and
2aebbf6 (ivtv) added an __init
annotation to the cx18-alsa-load and ivtv-alsa-load functions. However,
these functions are called *after* initialization by the main cx18/ivtv
driver. By that time the memory containing those functions is already
freed and your machine goes BOOM.

Cc: [email protected] # for 3.8
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Feb 11, 2013
1 parent 33f6984 commit cfb046c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-alsa-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int snd_cx18_init(struct v4l2_device *v4l2_dev)
return ret;
}

static int __init cx18_alsa_load(struct cx18 *cx)
static int cx18_alsa_load(struct cx18 *cx)
{
struct v4l2_device *v4l2_dev = &cx->v4l2_dev;
struct cx18_stream *s;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-alsa-pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 02111-1307 USA
*/

int __init snd_cx18_pcm_create(struct snd_cx18_card *cxsc);
int snd_cx18_pcm_create(struct snd_cx18_card *cxsc);

/* Used by cx18-mailbox to announce the PCM data to the module */
void cx18_alsa_announce_pcm_data(struct snd_cx18_card *card, u8 *pcm_data,
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-alsa-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static int snd_ivtv_init(struct v4l2_device *v4l2_dev)
return ret;
}

static int __init ivtv_alsa_load(struct ivtv *itv)
static int ivtv_alsa_load(struct ivtv *itv)
{
struct v4l2_device *v4l2_dev = &itv->v4l2_dev;
struct ivtv_stream *s;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-alsa-pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
* 02111-1307 USA
*/

int __init snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc);
int snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc);

0 comments on commit cfb046c

Please sign in to comment.