diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-11-10 19:52:08 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-11-10 19:52:08 +0100 |
commit | d938e66003c9ccc6c0ab10fa31ee23cf27574d66 (patch) | |
tree | c4bc45c786e62f25febf10fc9568ebe550802504 /sound/usb/quirks.c | |
parent | bcca5fa6d786755abe91f5856c9647a2ca2a51b6 (diff) | |
parent | 43df2a57b773596cd0bdd2316889ff9653121015 (diff) |
Merge branch 'fix/misc' into for-linus
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r-- | sound/usb/quirks.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 2e5bc734402..a3ddac0deff 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -137,12 +137,12 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, return -ENOMEM; } if (fp->nr_rates > 0) { - rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL); + rate_table = kmemdup(fp->rate_table, + sizeof(int) * fp->nr_rates, GFP_KERNEL); if (!rate_table) { kfree(fp); return -ENOMEM; } - memcpy(rate_table, fp->rate_table, sizeof(int) * fp->nr_rates); fp->rate_table = rate_table; } @@ -224,10 +224,9 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, if (altsd->bNumEndpoints != 1) return -ENXIO; - fp = kmalloc(sizeof(*fp), GFP_KERNEL); + fp = kmemdup(&ua_format, sizeof(*fp), GFP_KERNEL); if (!fp) return -ENOMEM; - memcpy(fp, &ua_format, sizeof(*fp)); fp->iface = altsd->bInterfaceNumber; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; |