Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

Commit

Permalink
net/can: mcp25xxfd: Fix an incorrect memset() usage
Browse files Browse the repository at this point in the history
/mnt/ssd/kernels/msm-4.9/drivers/net/can/spi/mcp25xxfd.c: In function ‘mcp25xxfd_can_ist_handle_status’:
/mnt/ssd/kernels/msm-4.9/drivers/net/can/spi/mcp25xxfd.c:3005:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
 3005 |  memset(priv->can_err_data, 0, 8);
      |  ^~~~~~

Fixes: 0d45bd3 ("driver: can: spi: add mcp25xxfd driver")
Signed-off-by: Albert I <[email protected]>
  • Loading branch information
krasCGQ authored and johnmart19 committed Feb 11, 2021
1 parent 2112a24 commit f7dde40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/spi/mcp25xxfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,7 @@ static int mcp25xxfd_can_ist_handle_status(struct spi_device *spi)
priv->bdiag1_clear_value = 0;
priv->bdiag1_clear_mask = 0;
priv->can_err_id = 0;
memset(priv->can_err_data, 0, 8);
memset(priv->can_err_data, 0, sizeof(priv->can_err_data));

/* state changes */
priv->new_state = priv->can.state;
Expand Down

0 comments on commit f7dde40

Please sign in to comment.