Project

General

Profile

Bug #10314

nvmeadm: NULL pointer errors

Added by Toomas Soome about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2019-01-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

NULL pointer errors:

    nvmeadm_dev.c: In function 'nvme_ioctl':
    nvmeadm_dev.c:44:53: error: comparison between pointer and integer [-Werror]
       if ((nioc.n_buf = (uintptr_t)calloc(*bufsize, 1)) == NULL)
                                                         ^~
    cc1: all warnings being treated as errors

As the calloc() result is casted to uintptr_t, we need to use 0, not NULL.

History

#1

Updated by Electric Monk 12 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 11f30dc397b17ef5d8b607824b7b028e4d3c4648

commit  11f30dc397b17ef5d8b607824b7b028e4d3c4648
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-08T01:25:00.000Z

    10314 nvmeadm: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
    Reviewed by: Andy Fiddaman <af@citrus-it.net>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF