lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v1 1/4] nvmet-trace: avoid dereferencing pointer too early
> +static inline u16 nvmet_req_to_ctrl_id(struct nvmet_req *req)
> {
> - return req->sq->ctrl;
> + if (!req->sq || !req->sq->ctrl)
> + return 0;
> + return req->sq->ctrl->cntlid;

Can you add a comment here why we have this check?

\
 
 \ /
  Last update: 2023-09-05 19:10    [W:0.170 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site