staging: unisys: visorbus: NULL pending_msg_hdr not an error
A NULL pending_msg_hdr is not an error, it just means that the firmware does not want an error response for that message. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
17e4bddadc
commit
fd9e450cf5
|
@ -690,8 +690,9 @@ void remove_visor_device(struct visor_device *dev)
|
||||||
{
|
{
|
||||||
list_del(&dev->list_all);
|
list_del(&dev->list_all);
|
||||||
put_device(&dev->device);
|
put_device(&dev->device);
|
||||||
|
if (dev->pending_msg_hdr)
|
||||||
|
visorbus_response(dev, 0, CONTROLVM_DEVICE_DESTROY);
|
||||||
device_unregister(&dev->device);
|
device_unregister(&dev->device);
|
||||||
visorbus_response(dev, 0, CONTROLVM_DEVICE_DESTROY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_vbus_header_info(struct visorchannel *chan,
|
static int get_vbus_header_info(struct visorchannel *chan,
|
||||||
|
|
|
@ -481,9 +481,6 @@ static int controlvm_responder(enum controlvm_id cmd_id,
|
||||||
struct controlvm_message_header *pending_msg_hdr,
|
struct controlvm_message_header *pending_msg_hdr,
|
||||||
int response)
|
int response)
|
||||||
{
|
{
|
||||||
if (!pending_msg_hdr)
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
if (pending_msg_hdr->id != (u32)cmd_id)
|
if (pending_msg_hdr->id != (u32)cmd_id)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -497,8 +494,6 @@ static int device_changestate_responder(
|
||||||
{
|
{
|
||||||
struct controlvm_message outmsg;
|
struct controlvm_message outmsg;
|
||||||
|
|
||||||
if (!p->pending_msg_hdr)
|
|
||||||
return -EIO;
|
|
||||||
if (p->pending_msg_hdr->id != cmd_id)
|
if (p->pending_msg_hdr->id != cmd_id)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -1391,8 +1386,10 @@ static void setup_crash_devices_work_queue(struct work_struct *work)
|
||||||
void visorbus_response(struct visor_device *bus_info, int response,
|
void visorbus_response(struct visor_device *bus_info, int response,
|
||||||
int controlvm_id)
|
int controlvm_id)
|
||||||
{
|
{
|
||||||
controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response);
|
if (!bus_info->pending_msg_hdr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response);
|
||||||
kfree(bus_info->pending_msg_hdr);
|
kfree(bus_info->pending_msg_hdr);
|
||||||
bus_info->pending_msg_hdr = NULL;
|
bus_info->pending_msg_hdr = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1401,9 +1398,11 @@ void visorbus_device_changestate_response(struct visor_device *dev_info,
|
||||||
int response,
|
int response,
|
||||||
struct visor_segment_state state)
|
struct visor_segment_state state)
|
||||||
{
|
{
|
||||||
|
if (!dev_info->pending_msg_hdr)
|
||||||
|
return;
|
||||||
|
|
||||||
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, dev_info,
|
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, dev_info,
|
||||||
response, state);
|
response, state);
|
||||||
|
|
||||||
kfree(dev_info->pending_msg_hdr);
|
kfree(dev_info->pending_msg_hdr);
|
||||||
dev_info->pending_msg_hdr = NULL;
|
dev_info->pending_msg_hdr = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue