[LU-6502] Strange check for NULL in LNetCtl Created: 27/Apr/15  Updated: 03/Aug/15  Resolved: 03/Aug/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Amir Shehata (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch highlights this interesting bit of code in LNetCtl:

                config = arg;

                if (config->cfg_hdr.ioc_len < total)
                        return -EINVAL;

                net_config = (struct lnet_ioctl_net_config *)
                        config->cfg_bulk;
                if (config == NULL || net_config == NULL)
                        return -1;

notic how we assume config can be NULL way after we defererenced it multiple times. should we move the check?



 Comments   
Comment by Gerrit Updater [ 28/Jul/15 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: http://review.whamcloud.com/15779
Subject: LU-6502 lnet: remove unnecessary NULL check
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 21f4374fab33579b2a5f3ed06975826ff4951b1d

Comment by Gerrit Updater [ 03/Aug/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15779/
Subject: LU-6502 lnet: remove unnecessary NULL check
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 5ebe1b768e7c8397036c94ca43848067269dbf50

Comment by Peter Jones [ 03/Aug/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:00:46 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.