ALSA: cmipci: Allocate with GFP_KERNEL instead of GFP_ATOMIC
authorTakashi Iwai <tiwai@suse.de>
Mon, 9 Apr 2018 20:09:27 +0000 (22:09 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 Apr 2018 12:01:31 +0000 (14:01 +0200)
save_mixer_state() is called in a sleepable context, so it's safe to
allocate with GFP_KERNEL instead of the current GFP_ATOMIC.  The
GFP_ATOMIC usage must have been based on an incorrect assumption in
the very old code base.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/cmipci.c

index 26a65787066420d983685f3c43f4bcc42a096eb5..452cc79b44af3f1dbd77efcf07e92099f770ea70 100644 (file)
@@ -1139,7 +1139,7 @@ static int save_mixer_state(struct cmipci *cm)
                struct snd_ctl_elem_value *val;
                unsigned int i;
 
-               val = kmalloc(sizeof(*val), GFP_ATOMIC);
+               val = kmalloc(sizeof(*val), GFP_KERNEL);
                if (!val)
                        return -ENOMEM;
                for (i = 0; i < CM_SAVED_MIXERS; i++) {