On 2020-04-30 06:18, Hannes Reinecke wrote: > void scsi_put_reserved_cmd(struct scsi_cmnd *scmd) > { > - struct request *rq = blk_mq_rq_from_pdu(scmd); > + struct request *rq; > > - blk_mq_free_request(rq); > + if (scmd && scsi_cmd_is_reserved(scmd)) { > + rq = blk_mq_rq_from_pdu(scmd); > + blk_mq_free_request(rq); > + } > } The above looks weird to me. Why to tolerate that a caller passes NULL as argument to this function? Additionally, wouldn't a WARN_ON_ONCE(!scsi_cmd_is_reserved(scmd)) be more appropriate instead of the if (scsi_cmd_is_reserved(scmd)) { ... } ? Thanks, Bart.