diff mbox

[1/5] Input: db9 - clear unused function pointers

Message ID 1447767619-28329-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Sudip Mukherjee Nov. 17, 2015, 1:40 p.m. UTC
db9_parport_cb is a local uninitialized structure and the member
function pointers will be pointing to arbitrary locations unless they
are cleared.

Fixes: 2260c419b52b ("Input: db9 - use parallel port device model")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/input/joystick/db9.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Torokhov Nov. 17, 2015, 6 p.m. UTC | #1
On Tue, Nov 17, 2015 at 07:10:15PM +0530, Sudip Mukherjee wrote:
> db9_parport_cb is a local uninitialized structure and the member
> function pointers will be pointing to arbitrary locations unless they
> are cleared.
> 
> Fixes: 2260c419b52b ("Input: db9 - use parallel port device model")
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Applied all 5, thank you.

> ---
>  drivers/input/joystick/db9.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
> index 932d073..da32609 100644
> --- a/drivers/input/joystick/db9.c
> +++ b/drivers/input/joystick/db9.c
> @@ -592,6 +592,7 @@ static void db9_attach(struct parport *pp)
>  		return;
>  	}
>  
> +	memset(&db9_parport_cb, 0, sizeof(db9_parport_cb));
>  	db9_parport_cb.flags = PARPORT_FLAG_EXCL;
>  
>  	pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx);
> -- 
> 1.9.1
>
Sudip Mukherjee Nov. 20, 2015, 8:34 a.m. UTC | #2
On Tue, Nov 17, 2015 at 10:00:52AM -0800, Dmitry Torokhov wrote:
> On Tue, Nov 17, 2015 at 07:10:15PM +0530, Sudip Mukherjee wrote:
> > db9_parport_cb is a local uninitialized structure and the member
> > function pointers will be pointing to arbitrary locations unless they
> > are cleared.
> > 
> > Fixes: 2260c419b52b ("Input: db9 - use parallel port device model")
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> 
> Applied all 5, thank you.

Thanks Dmitry. Hopefully this was the last of my careless mistakes.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index 932d073..da32609 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -592,6 +592,7 @@  static void db9_attach(struct parport *pp)
 		return;
 	}
 
+	memset(&db9_parport_cb, 0, sizeof(db9_parport_cb));
 	db9_parport_cb.flags = PARPORT_FLAG_EXCL;
 
 	pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx);