aboutsummaryrefslogtreecommitdiffstats
path: root/net/lapb/lapb_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/lapb/lapb_iface.c')
-rw-r--r--net/lapb/lapb_iface.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index aea6616cea3d1..7e6bc41eeb216 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -115,14 +115,12 @@ static struct lapb_cb *lapb_devtostruct(struct net_device *dev)
*/
static struct lapb_cb *lapb_create_cb(void)
{
- struct lapb_cb *lapb = kmalloc(sizeof(*lapb), GFP_ATOMIC);
+ struct lapb_cb *lapb = kzalloc(sizeof(*lapb), GFP_ATOMIC);
if (!lapb)
goto out;
- memset(lapb, 0x00, sizeof(*lapb));
-
skb_queue_head_init(&lapb->write_queue);
skb_queue_head_init(&lapb->ack_queue);
@@ -240,11 +238,13 @@ int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms)
goto out_put;
if (lapb->state == LAPB_STATE_0) {
- if (((parms->mode & LAPB_EXTENDED) &&
- (parms->window < 1 || parms->window > 127)) ||
- (parms->window < 1 || parms->window > 7))
- goto out_put;
-
+ if (parms->mode & LAPB_EXTENDED) {
+ if (parms->window < 1 || parms->window > 127)
+ goto out_put;
+ } else {
+ if (parms->window < 1 || parms->window > 7)
+ goto out_put;
+ }
lapb->mode = parms->mode;
lapb->window = parms->window;
}