Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: ps3: Use WARN_ON() instead of BUG_ON()

BUG_ON() is rather useless for debugging as it leads to panic().
Use WARN_ON() and handle the error cases accordingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+4 -2
+4 -2
sound/ppc/snd_ps3.c
··· 933 933 int i, ret; 934 934 u64 lpar_addr, lpar_size; 935 935 936 - BUG_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)); 937 - BUG_ON(dev->match_id != PS3_MATCH_ID_SOUND); 936 + if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1))) 937 + return -ENODEV; 938 + if (WARN_ON(dev->match_id != PS3_MATCH_ID_SOUND)) 939 + return -ENODEV; 938 940 939 941 the_card.ps3_dev = dev; 940 942