• Minwoo Im's avatar
    nvmet: return a specified error it subsys_alloc fails · 6b7e631b
    Minwoo Im authored
    nvmet_subsys_alloc() returns its pointer or NULL if it fails.  We can
    see three different steps in this function:
      1. memory allocation
      2. argument check
      3. memory allocation for string
    
    But now the callers of this function do not seem to handle case 2 by
    returning -ENOMEM only even if it fails with an invalid parameter.
    
    This patch specifies error codes so that caller can pass it to its own
    caller.
    Signed-off-by: default avatarMinwoo Im <minwoo.im.dev@gmail.com>
    Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    6b7e631b
core.c 34.6 KB