From: Dan Carpenter Date: Tue, 8 Nov 2011 03:31:45 +0000 (-0800) Subject: mwifiex: remove an unneeded NULL check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa161cb7aa7da29018f7378ccbab6bb593be008c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git mwifiex: remove an unneeded NULL check We dereference adapter in the error handling code so this needed to be fixed. This function is always called like: adapter->if_ops.host_to_card(adapter, ...); so adapter can never be NULL and I've removed the NULL check. Signed-off-by: Dan Carpenter Acked-by: Bing Zhao Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 44669763c4e..d12d4405548 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1671,9 +1671,8 @@ static int mwifiex_pcie_host_to_card(struct mwifiex_adapter *adapter, u8 type, struct sk_buff *skb, struct mwifiex_tx_param *tx_param) { - if (!adapter || !skb) { - dev_err(adapter->dev, "Invalid parameter in %s <%p, %p>\n", - __func__, adapter, skb); + if (!skb) { + dev_err(adapter->dev, "Passed NULL skb to %s\n", __func__); return -1; }