10138 smatch fixes for usr/src/cmd/sgs
@@ -27,10 +27,14 @@ /* * Copyright (c) 1988 AT&T * All Rights Reserved */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <memory.h> #include <malloc.h> #include <limits.h> #include <sgs.h>
@@ -741,13 +745,10 @@ { size_t sz; unsigned u; Ehdr *eh = elf->ed_ehdr; - if (elf == 0) - return (-1); - ELFWLOCK(elf) switch (cmd) { default: _elf_seterr(EREQ_UPDATE, 0); ELFUNLOCK(elf)