Re: [PATCH RESEND] [SCSI] raid class: Fix error handling in raid_component_add

From: Martin K. Petersen
Date: Fri Jan 10 2025 - 16:44:57 EST



> The reference count of the device incremented in device_initialize()
> is not decremented when device_add() fails. Add a put_device() call
> before returning from the function to decrement reference count for
> cleanup. Or it could cause memory leak.

60c5fd2e8f3c ("scsi: core: raid_class: Remove raid_component_add()")

--
Martin K. Petersen Oracle Linux Engineering