Skip to content

Commit

Permalink
Staging: hv: mousevsc: Fixup some bogus WARN_ON() calls
Browse files Browse the repository at this point in the history
Fix the bogus WARN_ON() calls.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Oct 4, 2011
1 parent 28e0d06 commit 7f2bad4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static struct mousevsc_dev *alloc_input_device(struct hv_device *device)

static void free_input_device(struct mousevsc_dev *device)
{
WARN_ON(atomic_read(&device->ref_count) == 0);
WARN_ON(atomic_read(&device->ref_count) != 0);
kfree(device);
}

Expand Down Expand Up @@ -327,7 +327,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,

/* Save the hid desc */
desc = &device_info->hid_descriptor;
WARN_ON(desc->bLength > 0);
WARN_ON(desc->bLength == 0);

input_device->hid_desc = kzalloc(desc->bLength, GFP_KERNEL);

Expand Down Expand Up @@ -447,7 +447,7 @@ static void mousevsc_on_receive(struct hv_device *device,
break;

case SynthHidInitialDeviceInfo:
WARN_ON(pipe_msg->size >= sizeof(struct hv_input_dev_info));
WARN_ON(pipe_msg->size < sizeof(struct hv_input_dev_info));

/*
* Parse out the device info into device attr,
Expand Down

0 comments on commit 7f2bad4

Please sign in to comment.