From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8747B26F29B for ; Fri, 8 May 2026 03:01:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778209275; cv=none; b=gazDBKeQDEzRYHViJd2yol4XDdcEshjjsMLeB3N/RVxqvgybj+UxoxJAWpERJ1ibmUgqEwAS3M8hHkIyU0wUkA21CO28sNnm33VbFoa62w0cwFpZoyiVmjlC9q3QtQNuxTt1OuxDM6loWvhDzXtjfBIa2hznrw5c/3vwgb7HPb0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778209275; c=relaxed/simple; bh=rc2WjeYEVMMur8mY/6t3yIh3q24Ux14jo9CsHoc8sow=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=PkOn5kWL2uJUAd7b9LEURjIqyE5snNm9fp4yqktx+Fn0zQBfmAOL3Kgj2lZojv/k6fi4BYqVypCumNwDpjZnONj36ZYFccGji4PVHva55NwrTUY+HlzNQUbI0kxIsAXLfZ5wDSCPXOcyexVzUgWZP9WamJMm4vPYGXMWqw/KDeM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-6967fe3eeb1so2227683eaf.0 for ; Thu, 07 May 2026 20:01:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778209273; x=1778814073; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RaORftu5H+1Qgz33KmLVKeljT1imR6f53VZ1+4asjGE=; b=QVXyEq1ibXkvhpMF4HemetqAhAiZadpLlLHaKXxwnk/2dHfMHceAGTXNXraMKOK9nn qvh8DZUnKki+7D5VQLrvUAO7DueYbQeakF1dtR1gwGD4yEme9g+7Rlnu665ngh7Z7Vem uipeOuFEyggCUsSlaFj+YTRPt3sOx9w4uixNcNJVrTcBGRTof9Kx6nsUyVtwQfAths2L DpGPk4cgrzcFp8iRNqDaUG7beCaQZfDPxDNGS09Mur9D9R2SReQqNKX7+7z6ABfkx0w7 0H/W5jgZB78JCjia7Mo8KsTMwVylayo/by7aKKvffEsueACHbi+Qw8AsXHWm7x03kv6I yAHw== X-Gm-Message-State: AOJu0YznKTGdf29tlTBjZ+afyq6yC3i6bSOnx+GF1mrFhTUT9w/VGv0W g5+9Vnb5ovtgQ93Lwid2m5peIy0qXV61ogDoKWKMoTgCnqbDM7nj+S2aA7IrVeg/6waZkAIPk0i rdwCRC5uL0GLNvGgPjXttEq4CBSZ2FIRF7rQ/Vy8O1aP4mvG21ImtfLVOHPg= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:161f:b0:694:6acf:a420 with SMTP id 006d021491bc7-69998cc4661mr5894340eaf.15.1778209273480; Thu, 07 May 2026 20:01:13 -0700 (PDT) Date: Thu, 07 May 2026 20:01:13 -0700 In-Reply-To: <69fd21b9.050a0220.3cf765.035f.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69fd51f9.a00a0220.a7d34.0002.GAE@google.com> Subject: Forwarded: [PATCH] media: msi2500: fix memory leak in msi2500_probe error path From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] media: msi2500: fix memory leak in msi2500_probe error path Author: daiky0325@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master When video_register_device() fails in msi2500_probe(), the error path jumps to err_unregister_v4l2_dev, which skips the call to v4l2_ctrl_handler_free(). This leaks memory allocated by v4l2_ctrl_handler_init() and v4l2_ctrl_add_handler(). Fix this by jumping to err_free_controls instead, which properly frees the control handler before unregistering the v4l2 device. Reported-by: syzbot+b1de0d5fd8a15fac11aa@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b1de0d5fd8a15fac11aa Signed-off-by: Daiki Harada --- drivers/media/usb/msi2500/msi2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c index 1ff98956b680..76e1f2bfab0c 100644 --- a/drivers/media/usb/msi2500/msi2500.c +++ b/drivers/media/usb/msi2500/msi2500.c @@ -1265,7 +1265,7 @@ static int msi2500_probe(struct usb_interface *intf, if (ret) { dev_err(dev->dev, "Failed to register as video device (%d)\n", ret); - goto err_unregister_v4l2_dev; + goto err_free_controls; } dev_info(dev->dev, "Registered as %s\n", video_device_node_name(&dev->vdev)); -- 2.54.0