aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/device.c')
-rw-r--r--sound/core/device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/core/device.c b/sound/core/device.c
index a67dfac08c03..2d1ad4b0cd65 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -225,15 +225,16 @@ int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd)
225{ 225{
226 struct snd_device *dev; 226 struct snd_device *dev;
227 int err; 227 int err;
228 unsigned int range_low, range_high; 228 unsigned int range_low, range_high, type;
229 229
230 if (snd_BUG_ON(!card)) 230 if (snd_BUG_ON(!card))
231 return -ENXIO; 231 return -ENXIO;
232 range_low = cmd * SNDRV_DEV_TYPE_RANGE_SIZE; 232 range_low = (__force unsigned int)cmd * SNDRV_DEV_TYPE_RANGE_SIZE;
233 range_high = range_low + SNDRV_DEV_TYPE_RANGE_SIZE - 1; 233 range_high = range_low + SNDRV_DEV_TYPE_RANGE_SIZE - 1;
234 __again: 234 __again:
235 list_for_each_entry(dev, &card->devices, list) { 235 list_for_each_entry(dev, &card->devices, list) {
236 if (dev->type >= range_low && dev->type <= range_high) { 236 type = (__force unsigned int)dev->type;
237 if (type >= range_low && type <= range_high) {
237 if ((err = snd_device_free(card, dev->device_data)) < 0) 238 if ((err = snd_device_free(card, dev->device_data)) < 0)
238 return err; 239 return err;
239 goto __again; 240 goto __again;