Commit 55abae43 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'firewire-fixes-6.7-rc4' of...

Merge tag 'firewire-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire fix from Takashi Sakamoto:
 "A single patch to fix long-standing issue of memory leak at failure of
  device registration for fw_unit. We rarely encounter the issue, but it
  should be applied to stable releases, since it fixes inappropriate API
  usage"

* tag 'firewire-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire: core: fix possible memory leak in create_units()
parents 1b8af655 891e0eab
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -717,14 +717,11 @@ static void create_units(struct fw_device *device)
					fw_unit_attributes,
					&unit->attribute_group);

		if (device_register(&unit->device) < 0)
			goto skip_unit;

		fw_device_get(device);
		if (device_register(&unit->device) < 0) {
			put_device(&unit->device);
			continue;

	skip_unit:
		kfree(unit);
		}
	}
}