sound/usb/usx2y/us144mkii_midi.c:65 tascam_midi_in_urb_complete() error: we previously assumed 'tascam' could be null (see line 54)
Dan Carpenter
build botBCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: "Šerif Rami" <[email protected]>
CC: Takashi Iwai <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next head: d9f0633867711cff87c5604a4f90daa8ab986e4f commit: 0ec417aa85467c6fad0563621b74868be0faf00d [17/18] ALSA: usb-audio: Add infrastructure for TASCAM US-144MKII
:::::: branch date: 4 hours ago
:::::: commit date: 4 days ago
config: powerpc64-randconfig-r073-20250819 (https://download.01.org/0day-ci/archive/20250819/[email protected]/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 93d24b6b7b148c47a2fa228a4ef31524fa1d9f3f)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
smatch warnings:sound/usb/usx2y/us144mkii_midi.c:65 tascam_midi_in_urb_complete() error: we previously assumed 'tascam' could be null (see line 54)
vim +/tascam +65 sound/usb/usx2y/us144mkii_midi.c
67afec157fe63d Šerif Rami 2025-08-14 38
67afec157fe63d Šerif Rami 2025-08-14 39 void tascam_midi_in_urb_complete(struct urb *urb)
67afec157fe63d Šerif Rami 2025-08-14 40 {
67afec157fe63d Šerif Rami 2025-08-14 41 struct tascam_card *tascam = urb->context;
67afec157fe63d Šerif Rami 2025-08-14 42 int ret;
67afec157fe63d Šerif Rami 2025-08-14 43
67afec157fe63d Šerif Rami 2025-08-14 44 if (urb->status) {
67afec157fe63d Šerif Rami 2025-08-14 45 if (urb->status != -ENOENT && urb->status != -ECONNRESET &&
67afec157fe63d Šerif Rami 2025-08-14 46 urb->status != -ESHUTDOWN && urb->status != -EPROTO) {
67afec157fe63d Šerif Rami 2025-08-14 47 dev_err_ratelimited(tascam->card->dev,
67afec157fe63d Šerif Rami 2025-08-14 48 "MIDI IN URB failed: status %d\n",
67afec157fe63d Šerif Rami 2025-08-14 49 urb->status);
67afec157fe63d Šerif Rami 2025-08-14 50 }
67afec157fe63d Šerif Rami 2025-08-14 51 goto out;
67afec157fe63d Šerif Rami 2025-08-14 52 }
67afec157fe63d Šerif Rami 2025-08-14 53
67afec157fe63d Šerif Rami 2025-08-14 @54 if (tascam && atomic_read(&tascam->midi_in_active) &&
67afec157fe63d Šerif Rami 2025-08-14 55 urb->actual_length > 0) {
67afec157fe63d Šerif Rami 2025-08-14 56 kfifo_in_spinlocked(&tascam->midi_in_fifo, urb->transfer_buffer,
67afec157fe63d Šerif Rami 2025-08-14 57 urb->actual_length, &tascam->midi_in_lock);
67afec157fe63d Šerif Rami 2025-08-14 58 schedule_work(&tascam->midi_in_work);
67afec157fe63d Šerif Rami 2025-08-14 59 }
67afec157fe63d Šerif Rami 2025-08-14 60
67afec157fe63d Šerif Rami 2025-08-14 61 usb_get_urb(urb);
67afec157fe63d Šerif Rami 2025-08-14 62 usb_anchor_urb(urb, &tascam->midi_in_anchor);
67afec157fe63d Šerif Rami 2025-08-14 63 ret = usb_submit_urb(urb, GFP_ATOMIC);
67afec157fe63d Šerif Rami 2025-08-14 64 if (ret < 0) {
67afec157fe63d Šerif Rami 2025-08-14 @65 dev_err(tascam->card->dev,
67afec157fe63d Šerif Rami 2025-08-14 66 "Failed to resubmit MIDI IN URB: error %d\n", ret);
67afec157fe63d Šerif Rami 2025-08-14 67 usb_unanchor_urb(urb);
67afec157fe63d Šerif Rami 2025-08-14 68 usb_put_urb(urb);
67afec157fe63d Šerif Rami 2025-08-14 69 }
67afec157fe63d Šerif Rami 2025-08-14 70 out:
67afec157fe63d Šerif Rami 2025-08-14 71 usb_put_urb(urb);
67afec157fe63d Šerif Rami 2025-08-14 72 }67afec157fe63d Šerif Rami 2025-08-14 73
:::::: The code at line 65 was first introduced by commit
:::::: 67afec157fe63d37f0d8f46fbe11a61364718ece ALSA: usb-audio: us144mkii: Add MIDI support and mixer controls
:::::: TO: Šerif Rami <[email protected]>
:::::: CC: Takashi Iwai <[email protected]>
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki