public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] isdn: type bug in isdn_net_header()
@ 2012-02-09 10:46 Dan Carpenter
  2012-02-09 11:34 ` Neil Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-02-09 10:46 UTC (permalink / raw)
  To: Karsten Keil
  Cc: David S. Miller, Lucas De Marchi, Neil Horman, netdev,
	kernel-janitors

We use len to store the return value from eth_header().  eth_header()
can return -ETH_HLEN (-14).  We want to pass this back instead of
truncating it to 65522 and returning that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
WARNING: Compile tested only.  I don't have this hardware.  Please check
that I am on the right track.

diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 2339d73..802ab87 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
 {
 	isdn_net_local *lp = netdev_priv(dev);
 	unsigned char *p;
-	ushort len = 0;
+	int len = 0;
 
 	switch (lp->p_encap) {
 		case ISDN_NET_ENCAP_ETHER:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] isdn: type bug in isdn_net_header()
  2012-02-09 10:46 [patch] isdn: type bug in isdn_net_header() Dan Carpenter
@ 2012-02-09 11:34 ` Neil Horman
  2012-02-09 20:41   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Horman @ 2012-02-09 11:34 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Karsten Keil, David S. Miller, Lucas De Marchi, netdev,
	kernel-janitors

On Thu, Feb 09, 2012 at 01:46:47PM +0300, Dan Carpenter wrote:
> We use len to store the return value from eth_header().  eth_header()
> can return -ETH_HLEN (-14).  We want to pass this back instead of
> truncating it to 65522 and returning that.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> WARNING: Compile tested only.  I don't have this hardware.  Please check
> that I am on the right track.
> 
> diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
> index 2339d73..802ab87 100644
> --- a/drivers/isdn/i4l/isdn_net.c
> +++ b/drivers/isdn/i4l/isdn_net.c
> @@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
>  {
>  	isdn_net_local *lp = netdev_priv(dev);
>  	unsigned char *p;
> -	ushort len = 0;
> +	int len = 0;
>  
>  	switch (lp->p_encap) {
>  		case ISDN_NET_ENCAP_ETHER:
> 
Looks reasonable
Acked-by: Neil Horman <nhorman@tuxdriver.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] isdn: type bug in isdn_net_header()
  2012-02-09 11:34 ` Neil Horman
@ 2012-02-09 20:41   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-02-09 20:41 UTC (permalink / raw)
  To: nhorman; +Cc: dan.carpenter, isdn, lucas.demarchi, netdev, kernel-janitors

From: Neil Horman <nhorman@tuxdriver.com>
Date: Thu, 9 Feb 2012 06:34:11 -0500

> On Thu, Feb 09, 2012 at 01:46:47PM +0300, Dan Carpenter wrote:
>> We use len to store the return value from eth_header().  eth_header()
>> can return -ETH_HLEN (-14).  We want to pass this back instead of
>> truncating it to 65522 and returning that.
>> 
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>> WARNING: Compile tested only.  I don't have this hardware.  Please check
>> that I am on the right track.
>> 
>> diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
>> index 2339d73..802ab87 100644
>> --- a/drivers/isdn/i4l/isdn_net.c
>> +++ b/drivers/isdn/i4l/isdn_net.c
>> @@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
>>  {
>>  	isdn_net_local *lp = netdev_priv(dev);
>>  	unsigned char *p;
>> -	ushort len = 0;
>> +	int len = 0;
>>  
>>  	switch (lp->p_encap) {
>>  		case ISDN_NET_ENCAP_ETHER:
>> 
> Looks reasonable
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-09 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09 10:46 [patch] isdn: type bug in isdn_net_header() Dan Carpenter
2012-02-09 11:34 ` Neil Horman
2012-02-09 20:41   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox