lkml.org 
[lkml]   [2022]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.4 05/55] ipw2x00: Fix potential NULL dereference in libipw_xmit()
    Date
    From: Haowen Bai <baihaowen@meizu.com>

    [ Upstream commit e8366bbabe1d207cf7c5b11ae50e223ae6fc278b ]

    crypt and crypt->ops could be null, so we need to checking null
    before dereference

    Signed-off-by: Haowen Bai <baihaowen@meizu.com>
    Signed-off-by: Kalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
    index d9baa2fa603b..e4c60caa6543 100644
    --- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
    +++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
    @@ -383,7 +383,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)

    /* Each fragment may need to have room for encryption
    * pre/postfix */
    - if (host_encrypt)
    + if (host_encrypt && crypt && crypt->ops)
    bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len +
    crypt->ops->extra_mpdu_postfix_len;

    --
    2.35.1
    \
     
     \ /
      Last update: 2022-05-30 16:29    [W:4.160 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site