Skip to contentSkip to conversation

moxa: dcd handling of CLOCAL is backwards

PATCH New Alan Cox 1 participant 2 messages Nov 1, 2012 TTY layer and serial drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/2 moxa: dcd handling of CLOCAL is backwards

From: Alan Cox <[email protected]>

We should do hangup on dcd loss if CLOCAL is false not true.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=49911
---

 drivers/tty/moxa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/moxa.c +1 -1
index 56e616b..9b57aae 100644
@@ -1370,7 +1370,7 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
         	p->DCDState = dcd;
         	spin_unlock_irqrestore(&p->port.lock, flags);
 		tty = tty_port_tty_get(&p->port);
-		if (tty && C_CLOCAL(tty) && !dcd)
+		if (tty && !C_CLOCAL(tty) && !dcd)
 			tty_hangup(tty);
 		tty_kref_put(tty);
 	}
author
#1 lore raw

PATCH 2/2 ipwireless: don't oops if we run out of space

From: Alan Cox <[email protected]>

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=49851

---

 drivers/tty/ipwireless/network.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/tty/ipwireless/network.c +4 -1
index 57102e6..c0dfb64 100644
@@ -352,6 +352,8 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data,
 	}
 
 	skb = dev_alloc_skb(length + 4);
+	if (skb == NULL)
+		return NULL;
 	skb_reserve(skb, 2);
 	memcpy(skb_put(skb, length), data, length);
 
@@ -397,7 +399,8 @@ void ipwireless_network_packet_received(struct ipw_network *network,
 
 				/* Send the data to the ppp_generic module. */
 				skb = ipw_packet_received_skb(data, length);
-				ppp_input(network->ppp_channel, skb);
+				if (skb)
+					ppp_input(network->ppp_channel, skb);
 			} else
 				spin_unlock_irqrestore(&network->lock,
 						flags);