Skip to content

Commit

Permalink
Fix wrong comparison in uiomux_phys_to_virt()
Browse files Browse the repository at this point in the history
uio_map_phys_to_virt() returns a void pointer value or NULL,
not unsigned long value -1. This patch fixes checking return
value of uio_map_phys_to_virt() in uiomux_phys_to_virt().
  • Loading branch information
Katsuya Matsubara authored and kfish committed Mar 19, 2010
1 parent 84b1be6 commit ce9b703
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libuiomux/uiomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,12 @@ uiomux_phys_to_virt(struct uiomux *uiomux, uiomux_resource_t blockmask,

if ((ret =
uio_map_phys_to_virt(&block->uio->mem,
phys_address)) != (unsigned long) -1)
phys_address)) != NULL)
return ret;

if ((ret =
uio_map_phys_to_virt(&block->uio->mmio,
phys_address)) != (unsigned long) -1)
phys_address)) != NULL)
return ret;

return NULL;
Expand Down

0 comments on commit ce9b703

Please sign in to comment.