[PATCH 134/141] staging: unisys: Hide vbus_hdr_info from public visor_device

Dan Carpenter dan.carpenter at oracle.com
Fri May 8 08:34:57 UTC 2015


On Tue, May 05, 2015 at 06:37:51PM -0400, Benjamin Romer wrote:
> From: Don Zickus <dzickus at redhat.com>
> @@ -1230,8 +1231,16 @@ create_bus_instance(struct visor_device *vdev)
>  {
>  	int rc;
>  	u32 id = vdev->chipset_bus_no;
> +	struct spar_vbus_headerinfo *hdr_info;
>  
>  	POSTCODE_LINUX_2(BUS_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
> +
> +	hdr_info = kzalloc(sizeof(struct spar_vbus_headerinfo), GFP_KERNEL);
> +	if (!hdr_info) {
> +		rc = -ENOMEM;
> +		goto away;
> +	}
> +	vdev->vbus_hdr_info = (void *)hdr_info;
>  	dev_set_name(&vdev->device, "visorbus%d", id);
>  	vdev->device.bus = &visorbus_type;
>  	vdev->device.groups = visorbus_groups;

This function leaks hdr_info on later error paths.

regards,
dan carpenter


More information about the devel mailing list