Correct all comparisons with NULL so that NULL isn't needed.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
void *rc = NULL;
p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY);
void *rc = NULL;
p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY);
rc = NULL;
goto cleanup;
}
rc = NULL;
goto cleanup;
}
spin_lock_init(&p->remove_lock);
/* prepare chan_hdr (abstraction to read/write channel memory) */
spin_lock_init(&p->remove_lock);
/* prepare chan_hdr (abstraction to read/write channel memory) */
p->memregion =
visor_memregion_create(physaddr,
sizeof(struct channel_header));
p->memregion =
visor_memregion_create(physaddr,
sizeof(struct channel_header));
p->memregion =
visor_memregion_create_overlapped(parent->memregion,
off, sizeof(struct channel_header));
p->memregion =
visor_memregion_create_overlapped(parent->memregion,
off, sizeof(struct channel_header));
- if (p->memregion == NULL) {
rc = NULL;
goto cleanup;
}
rc = NULL;
goto cleanup;
}
- if (rc == NULL) {
- if (p != NULL) {
visorchannel_destroy(p);
p = NULL;
}
visorchannel_destroy(p);
p = NULL;
}
void
visorchannel_destroy(struct visorchannel *channel)
{
void
visorchannel_destroy(struct visorchannel *channel)
{
- if (channel->memregion != NULL) {
+ if (channel->memregion) {
visor_memregion_destroy(channel->memregion);
channel->memregion = NULL;
}
visor_memregion_destroy(channel->memregion);
channel->memregion = NULL;
}
int written = 0;
u8 *buf = vmalloc(bufsize);
int written = 0;
u8 *buf = vmalloc(bufsize);
goto cleanup;
memset(buf, ch, bufsize);
goto cleanup;
memset(buf, ch, bufsize);
vfree(buf);
buf = NULL;
}
vfree(buf);
buf = NULL;
}
int i = 0;
int errcode = 0;
int i = 0;
int errcode = 0;
memregion = channel->memregion;
memregion = channel->memregion;
return;
addr = visor_memregion_get_physaddr(memregion);
return;
addr = visor_memregion_get_physaddr(memregion);