All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: peak_canfd: fix uninitialized symbol warnings
@ 2017-05-03  8:35 Stephane Grosjean
  2017-05-16 10:07 ` Stephane Grosjean
  0 siblings, 1 reply; 4+ messages in thread
From: Stephane Grosjean @ 2017-05-03  8:35 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can Mailing List, Stephane Grosjean

This patch fixes two uninitialized symbol warnings in the new code adding
support of the PEAK-System PCAN-PCI Express FD boards, in the socket-CAN
network protocol family.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
---
 drivers/net/can/peak_canfd/peak_canfd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/peak_canfd/peak_canfd.c b/drivers/net/can/peak_canfd/peak_canfd.c
index 0d57be5..912bd81 100644
--- a/drivers/net/can/peak_canfd/peak_canfd.c
+++ b/drivers/net/can/peak_canfd/peak_canfd.c
@@ -399,8 +399,9 @@ static int pucan_handle_status(struct peak_canfd_priv *priv,
 	} else if (priv->can.state != CAN_STATE_ERROR_ACTIVE) {
 		/* back to ERROR_ACTIVE */
 		netdev_dbg(ndev, "Error active status\n");
-		can_change_state(ndev, cf, CAN_STATE_ERROR_ACTIVE,
-				 CAN_STATE_ERROR_ACTIVE);
+		if (skb)
+			can_change_state(ndev, cf, CAN_STATE_ERROR_ACTIVE,
+					 CAN_STATE_ERROR_ACTIVE);
 	} else {
 		dev_kfree_skb(skb);
 		return 0;
@@ -489,7 +490,7 @@ int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
 				struct pucan_rx_msg *msg_list, int msg_count)
 {
 	void *msg_ptr = msg_list;
-	int i, msg_size;
+	int i, msg_size = 0;
 
 	for (i = 0; i < msg_count; i++) {
 		msg_size = peak_canfd_handle_msg(priv, msg_ptr);
-- 
2.7.4


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

end of thread, other threads:[~2017-05-18  8:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03  8:35 [PATCH] can: peak_canfd: fix uninitialized symbol warnings Stephane Grosjean
2017-05-16 10:07 ` Stephane Grosjean
2017-05-16 10:21   ` Marc Kleine-Budde
2017-05-18  8:21   ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.