diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2019-10-08 09:43:01 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-08 14:44:56 +0200 |
commit | b5be2aa3b3ac153f056f93406c520dc74a1cebbe (patch) | |
tree | 97bd40357c828e475d64c31e63432bb05d4f7781 /drivers/staging/wfx/bh.c | |
parent | 51f589c82f6d4b3c9e417b39141836fb3db86093 (diff) |
staging: wfx: drop calls to BUG_ON()
Most of calls to BUG_ON() could replaced by WARN().
By the way, this patch also try to favor WARN() (that include a comment
about the problem) instead of WARN_ON().
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/bh.c')
-rw-r--r-- | drivers/staging/wfx/bh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 3715bb18bd78..3355183fc86c 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -56,7 +56,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) int release_count; int piggyback = 0; - WARN_ON(read_len < 4); + WARN(read_len < 4, "corrupted read"); WARN(read_len > round_down(0xFFF, 2) * sizeof(u16), "%s: request exceed WFx capability", __func__); @@ -173,7 +173,7 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) bool is_encrypted = false; size_t len = le16_to_cpu(hif->len); - BUG_ON(len < sizeof(*hif)); + WARN(len < sizeof(*hif), "try to send corrupted data"); hif->seqnum = wdev->hif.tx_seqnum; wdev->hif.tx_seqnum = (wdev->hif.tx_seqnum + 1) % (HIF_COUNTER_MAX + 1); |