Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 621f5e18 authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman
Browse files

staging: unisys: visorbus: add error handling to chipset_bus_create



The function chipset_bus_create should return an error. If an error
is returned, it is assumed the response has not been sent by bus_create.

Correctly handle when the error has been returned in visorchipset.

Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarReviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e030d39d
Loading
Loading
Loading
Loading
+9 −8
Original line number Original line Diff line number Diff line
@@ -1090,24 +1090,25 @@ remove_all_visor_devices(void)
	}
	}
}
}


void
int
chipset_bus_create(struct visor_device *dev)
chipset_bus_create(struct visor_device *dev)
{
{
	int rc;
	int err;
	u32 bus_no = dev->chipset_bus_no;
	u32 bus_no = dev->chipset_bus_no;


	POSTCODE_LINUX(BUS_CREATE_ENTRY_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
	POSTCODE_LINUX(BUS_CREATE_ENTRY_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
	rc = create_bus_instance(dev);
	err = create_bus_instance(dev);
	POSTCODE_LINUX(BUS_CREATE_EXIT_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
	POSTCODE_LINUX(BUS_CREATE_EXIT_PC, 0, bus_no, DIAG_SEVERITY_PRINT);


	if (rc < 0)
	if (err < 0) {
		POSTCODE_LINUX(BUS_CREATE_FAILURE_PC, 0, bus_no,
		POSTCODE_LINUX(BUS_CREATE_FAILURE_PC, 0, bus_no,
			       DIAG_SEVERITY_ERR);
			       DIAG_SEVERITY_ERR);
	else
		return err;
		POSTCODE_LINUX(CHIPSET_INIT_SUCCESS_PC, 0, bus_no,
	}
			       DIAG_SEVERITY_PRINT);

	bus_create_response(dev, err);


	bus_create_response(dev, rc);
	return 0;
}
}


void
void
+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@
 * command line
 * command line
 */
 */


void chipset_bus_create(struct visor_device *bus_info);
int chipset_bus_create(struct visor_device *bus_info);
void chipset_bus_destroy(struct visor_device *bus_info);
void chipset_bus_destroy(struct visor_device *bus_info);
void chipset_device_create(struct visor_device *dev_info);
void chipset_device_create(struct visor_device *dev_info);
void chipset_device_destroy(struct visor_device *dev_info);
void chipset_device_destroy(struct visor_device *dev_info);
+7 −1
Original line number Original line Diff line number Diff line
@@ -656,11 +656,17 @@ bus_create(struct controlvm_message *inmsg)
	bus_info->visorchannel = visorchannel;
	bus_info->visorchannel = visorchannel;


	/* Response will be handled by chipset_bus_create */
	/* Response will be handled by chipset_bus_create */
	chipset_bus_create(bus_info);
	err = chipset_bus_create(bus_info);
	/* If error chipset_bus_create didn't respond, need to respond here */
	if (err)
		goto err_destroy_channel;


	POSTCODE_LINUX(BUS_CREATE_EXIT_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
	POSTCODE_LINUX(BUS_CREATE_EXIT_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
	return 0;
	return 0;


err_destroy_channel:
	visorchannel_destroy(visorchannel);

err_free_pending_msg:
err_free_pending_msg:
	kfree(bus_info->pending_msg_hdr);
	kfree(bus_info->pending_msg_hdr);