Print this page
10124 smatch fixes for cryptoadm

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c
          +++ new/usr/src/cmd/cmd-crypto/cryptoadm/adm_kef_ioctl.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25   25   * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
       26 + * Copyright (c) 2018, Joyent, Inc.
  26   27   */
  27   28  
  28   29  #include <fcntl.h>
  29   30  #include <stdio.h>
  30   31  #include <stdlib.h>
  31   32  #include <strings.h>
  32   33  #include <unistd.h>
  33   34  #include <locale.h>
  34   35  #include <libgen.h>
  35   36  #include <sys/types.h>
↓ open down ↓ 223 lines elided ↑ open up ↑
 259  260          pdevlist = malloc(sizeof (crypto_get_dev_list_t) +
 260  261              sizeof (crypto_dev_list_entry_t) * (count - 1));
 261  262          if (pdevlist == NULL) {
 262  263                  cryptodebug("out of memory.");
 263  264                  return (FAILURE);
 264  265          }
 265  266  
 266  267          if ((fd = open(ADMIN_IOCTL_DEVICE, O_RDONLY)) == -1) {
 267  268                  cryptoerror(LOG_STDERR, gettext("failed to open %s: %s"),
 268  269                      ADMIN_IOCTL_DEVICE, strerror(errno));
      270 +                free(pdevlist);
 269  271                  return (FAILURE);
 270  272          }
 271  273  
 272  274          pdevlist->dl_dev_count = count;
 273  275          if (ioctl(fd, CRYPTO_GET_DEV_LIST, pdevlist) == -1) {
 274  276                  cryptodebug("CRYPTO_GET_DEV_LIST ioctl failed: %s",
 275  277                      strerror(errno));
 276  278                  free(pdevlist);
 277  279                  (void) close(fd);
 278  280                  return (FAILURE);
↓ open down ↓ 332 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX