[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 |
| Comment by Gerrit Updater [ 03/Aug/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15779/ |
| Comment by Peter Jones [ 03/Aug/15 ] |
|
Landed for 2.8 |