[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <117fbf407a554684b4d72ab06b033eeb@SN2PR03MB061.namprd03.prod.outlook.com>
Date: Mon, 16 Sep 2013 18:42:25 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
CC: Dmitry Torokhov <dmitry.torokhov@...il.com>,
"olaf@...fle.de" <olaf@...fle.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"vojtech@...e.cz" <vojtech@...e.cz>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
"apw@...onical.com" <apw@...onical.com>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>
Subject: RE: [PATCH 1/1] Drivers: input: serio: New driver to support
Hyper-V synthetic keyboard
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@...cle.com]
> Sent: Monday, September 16, 2013 11:33 AM
> To: KY Srinivasan
> Cc: Dmitry Torokhov; olaf@...fle.de; gregkh@...uxfoundation.org;
> jasowang@...hat.com; linux-kernel@...r.kernel.org; vojtech@...e.cz; linux-
> input@...r.kernel.org; apw@...onical.com; devel@...uxdriverproject.org
> Subject: Re: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V
> synthetic keyboard
>
> Just roll something like the following into your patch.
>
> regards,
> dan carpenter
>
> diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-
> keyboard.c
> index 0d4625f..262721b 100644
> --- a/drivers/input/serio/hyperv-keyboard.c
> +++ b/drivers/input/serio/hyperv-keyboard.c
> @@ -151,15 +151,18 @@ static void hv_kbd_free_device(struct hv_kbd_dev
> *device)
> }
>
> static void hv_kbd_on_receive(struct hv_device *device,
> - struct vmpacket_descriptor *packet)
> + struct vmpacket_descriptor *packet, size_t size)
> {
> struct synth_kbd_msg *msg;
> struct hv_kbd_dev *kbd_dev = hv_get_drvdata(device);
> struct synth_kbd_keystroke *ks_msg;
> + int offset;
> u16 scan_code;
>
> - msg = (struct synth_kbd_msg *)((unsigned long)packet +
> - (packet->offset8 << 3));
> + offset = packet->offset8 << 3;
> + if (offset + sizeof(struct synth_kbd_protocol_response) > size)
> + return;
> + msg = (void *)packet + offset;
>
> switch (msg->header.type) {
> case SYNTH_KBD_PROTOCOL_RESPONSE:
> @@ -220,7 +223,7 @@ static void hv_kbd_on_channel_callback(void *context)
> break;
>
> case VM_PKT_DATA_INBAND:
> - hv_kbd_on_receive(device, desc);
> + hv_kbd_on_receive(device, desc, bytes_recvd);
> break;
>
> default:
Dan,
Rolling the changes you have indicated is not the issue; this can trivially be done.
My contention is that it is not needed given that the underlying function is already
doing that. Look at the function vmbus_recvpacket_raw() in drivers/hv/channel.c.
Regards,
K. Y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists