Message ID | 20181129142406.GV3073@unbuntlaptop (mailing list archive) |
---|---|
State | Accepted |
Commit | 27120f2ac995d83fef383fb20e492037ecf09259 |
Delegated to: | Kalle Valo |
Headers | show |
Series | ath10k: remove an unnecessary NULL check | expand |
Dan Carpenter <dan.carpenter@oracle.com> wrote: > The "survey" pointer is the address of an array element. We know that > it can't be NULL so this check can be removed. > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Patch applied to ath-next branch of ath.git, thanks. 27120f2ac995 ath10k: remove an unnecessary NULL check
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 659513bf4ddc..6a04727b63ce 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar, survey = &ar->survey[idx]; - if (!params->mac_clk_mhz || !survey) + if (!params->mac_clk_mhz) return; memset(survey, 0, sizeof(*survey));
The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- Resending with linux-wireless Cc for patchwork. drivers/net/wireless/ath/ath10k/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)