Skip to content

Commit

Permalink
lm32-dis: fix NULL pointer dereference
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Walle <[email protected]>
  • Loading branch information
mwalle committed Mar 18, 2013
1 parent b92e062 commit ab2b9f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions disas/lm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ int print_insn_lm32(bfd_vma memaddr, struct disassemble_info *info)
}
case 'c': {
uint8_t csr;
const char *csr_name;
const Lm32CsrInfo *info;
csr = (op >> 21) & 0x1f;
csr_name = find_csr_info(csr)->name;
if (csr_name) {
fprintf_fn(stream, "%s", csr_name);
info = find_csr_info(csr);
if (info) {
fprintf_fn(stream, "%s", info->name);
} else {
fprintf_fn(stream, "0x%x", csr);
}
Expand Down

0 comments on commit ab2b9f1

Please sign in to comment.