]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: cx25821-alsa: replace BUG_ON() with WARN_ON()
authorAtharv Dubey <atharvd440@gmail.com>
Fri, 13 Mar 2026 20:32:22 +0000 (02:02 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 16 Mar 2026 10:51:55 +0000 (11:51 +0100)
media: cx25821-alsa: replace BUG_ON() with WARN_ON()

Avoid crashing the kernel for a recoverable condition
by replacing BUG_ON() with WARN_ON().

Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/cx25821/cx25821-alsa.c

index 3f73391f9098775017b49e23a8cb76a14d624510..4fdc59aaed8eea7258c96a3b26896af23ace3c1e 100644 (file)
@@ -397,7 +397,7 @@ static int dsp_buffer_free(struct cx25821_audio_dev *chip)
 {
        struct cx25821_riscmem *risc = &chip->buf->risc;
 
-       BUG_ON(!chip->dma_size);
+       WARN_ON(!chip->dma_size);
 
        dprintk(2, "Freeing buffer\n");
        cx25821_alsa_dma_unmap(chip);
@@ -509,8 +509,8 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
        chip->num_periods = params_periods(hw_params);
        chip->dma_size = chip->period_size * params_periods(hw_params);
 
-       BUG_ON(!chip->dma_size);
-       BUG_ON(chip->num_periods & (chip->num_periods - 1));
+       WARN_ON(!chip->dma_size);
+       WARN_ON(chip->num_periods & (chip->num_periods - 1));
 
        buf = kzalloc_obj(*buf);
        if (NULL == buf)