Showing error 745

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: sound/pci/riptide/riptide.c
Line in file: 1661
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Smatch (1.59)
Entered: 2011-11-07 22:22:22 UTC


Source:

1631static int snd_riptide_playback_open(struct snd_pcm_substream *substream)
1632{
1633        struct snd_riptide *chip = snd_pcm_substream_chip(substream);
1634        struct snd_pcm_runtime *runtime = substream->runtime;
1635        struct pcmhw *data;
1636        int sub_num = substream->number;
1637
1638        chip->playback_substream[sub_num] = substream;
1639        runtime->hw = snd_riptide_playback;
1640        data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);
1641        data->paths = lbus_play_paths[sub_num];
1642        data->id = play_ids[sub_num];
1643        data->source = play_sources[sub_num];
1644        data->intdec[0] = 0xff;
1645        data->intdec[1] = 0xff;
1646        data->state = ST_STOP;
1647        runtime->private_data = data;
1648        return snd_pcm_hw_constraint_integer(runtime,
1649                                             SNDRV_PCM_HW_PARAM_PERIODS);
1650}
1651
1652static int snd_riptide_capture_open(struct snd_pcm_substream *substream)
1653{
1654        struct snd_riptide *chip = snd_pcm_substream_chip(substream);
1655        struct snd_pcm_runtime *runtime = substream->runtime;
1656        struct pcmhw *data;
1657
1658        chip->capture_substream = substream;
1659        runtime->hw = snd_riptide_capture;
1660        data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);
1661        data->paths = lbus_rec_path;
1662        data->id = PADC;
1663        data->source = ACLNK2PADC;
1664        data->intdec[0] = 0xff;
1665        data->intdec[1] = 0xff;
1666        data->state = ST_STOP;
1667        runtime->private_data = data;
1668        return snd_pcm_hw_constraint_integer(runtime,
1669                                             SNDRV_PCM_HW_PARAM_PERIODS);
1670}
1671
Show full sources