Skip to content

Commit

Permalink
cfg80211: fix wdev tracing crash
Browse files Browse the repository at this point in the history
Arend reported a crash in tracing if the driver returns an
ERR_PTR() value from the add_virtual_intf() callback. This
is due to the tracing then still attempting to dereference
the "pointer", fix this by using IS_ERR_OR_NULL().

Reported-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Mar 20, 2013
1 parent 07e5a5f commit ce1eadd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/wireless/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#define WIPHY_PR_ARG __entry->wiphy_name

#define WDEV_ENTRY __field(u32, id)
#define WDEV_ASSIGN (__entry->id) = (wdev ? wdev->identifier : 0)
#define WDEV_ASSIGN (__entry->id) = (!IS_ERR_OR_NULL(wdev) \
? wdev->identifier : 0)
#define WDEV_PR_FMT "wdev(%u)"
#define WDEV_PR_ARG (__entry->id)

Expand Down

0 comments on commit ce1eadd

Please sign in to comment.