Created attachment 303838 [details] change suggestion Further data processing is performed after an allocation of a buffer instance succeeded. The variable “instance” contains a valid pointer then. But this pointer was checked again after the creation of a tracefs instance failed within the implementation of the function “allocate_instance”. https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/tree/tracecmd/trace-record.c?id=0a68daed9f58e4429c0f1e7818f7cc0634873112#n360 * I suggest to remove the redundant check. * May it be avoided to pass a null pointer to a call of the function “tracefs_instance_free”?
The code is fine as is.
(In reply to Steven Rostedt from comment #1) Your patch indicates other information, doesn't it? trace-cmd record: Remove redundant check of instance in allocate_instance() https://lore.kernel.org/linux-trace-devel/20230602040123.3ce83b19@rorschach.local.home/
Fixed by: 22ad81e4818d ("trace-cmd record: Remove redundant check of instance in allocate_instance()")