lkml.org 
[lkml]   [2019]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nvme/pci: Use host managed power state for suspend
> > +	union nvme_result res;
> > + int ret;
> > +
> > + if (!result)
> > + return -EINVAL;
> > +
> > + memset(&c, 0, sizeof(c));
> > + c.features.opcode = nvme_admin_get_features;
> > + c.features.fid = cpu_to_le32(NVME_FEAT_POWER_MGMT);
> > +
> > + ret = __nvme_submit_sync_cmd(ctrl->admin_q, &c, &res,
> > + NULL, 0, 0, NVME_QID_ANY, 0, 0, false);
> > + if (ret >= 0)
> > + *result = le32_to_cpu(res.u32);
> May be add a check for result here in above if before deref pointer :-
> if (ret >= 0 && result)
>

'result' already has been checked in a few lines above.

\
 
 \ /
  Last update: 2019-05-12 16:31    [W:0.155 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site