Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
const char *log_len = "number of bytes to retrieve";
const char *raw = "use binary output";
void *pevent_log_info;
- struct nvme_persistent_event_log_head *pevent_log_head;
+ struct nvme_persistent_event_log_head *pevent_log_head = NULL;
enum nvme_print_flags flags;
int err, fd;
bool huge;
if (cfg.raw_binary)
flags = BINARY;
+ if (cfg.action > 3) {
+ fprintf(stderr, "invalid action field: %u\n", cfg.action);
+ errno = EINVAL;
+ err = -1;
+ goto close_fd;
+ }
+
pevent_log_head = calloc(sizeof(*pevent_log_head), 1);
if (!pevent_log_head) {
perror("could not alloc buffer for persistent " \