Browse Source

ALSA: cmipci: Allocate with GFP_KERNEL instead of GFP_ATOMIC

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>
Takashi Iwai 7 năm trước cách đây
mục cha
commit
0be5168047
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      sound/pci/cmipci.c

+ 1 - 1
sound/pci/cmipci.c

@@ -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++) {