* [PATCH 1/2] staging: unisys: unneeded NULL check
@ 2014-11-07 12:18 Sudip Mukherjee
2014-11-07 12:18 ` [PATCH 2/2] staging: unisys: dereferencing NULL pointer Sudip Mukherjee
0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2014-11-07 12:18 UTC (permalink / raw)
To: Benjamin Romer, David Kershner, Greg Kroah-Hartman
Cc: Sudip Mukherjee, sparmaintainer, devel, linux-kernel
the NULL check for memregion is not required as it has already been
checked for NULL after kzalloc. so we can reach this part of the code
only if memregion is not NULL.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/unisys/visorutil/memregion_direct.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c b/drivers/staging/unisys/visorutil/memregion_direct.c
index 65bc07b..aad19e4 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -57,10 +57,8 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
rc = memregion;
Away:
if (rc == NULL) {
- if (memregion != NULL) {
- visor_memregion_destroy(memregion);
- memregion = NULL;
- }
+ visor_memregion_destroy(memregion);
+ memregion = NULL;
}
return rc;
}
--
1.8.1.2
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 2/2] staging: unisys: dereferencing NULL pointer
2014-11-07 12:18 [PATCH 1/2] staging: unisys: unneeded NULL check Sudip Mukherjee
@ 2014-11-07 12:18 ` Sudip Mukherjee
0 siblings, 0 replies; 2+ messages in thread
From: Sudip Mukherjee @ 2014-11-07 12:18 UTC (permalink / raw)
To: Benjamin Romer, David Kershner, Greg Kroah-Hartman
Cc: Sudip Mukherjee, sparmaintainer, devel, linux-kernel
we can reach the label Away in total five situation and in four of
of them pDevInfo is NULL. so we were basically dereferencing a NULL
pointer.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/unisys/visorchipset/visorchipset_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b5a0e46..c8f7bea 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1298,7 +1298,8 @@ my_device_create(struct controlvm_message *inmsg)
POSTCODE_SEVERITY_INFO);
Away:
/* get the bus and devNo for DiagPool channel */
- if (is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
+ if (pDevInfo &&
+ is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
g_diagpoolBusNo = busNo;
g_diagpoolDevNo = devNo;
LOGINF("CONTROLVM_DEVICE_CREATE for DiagPool channel: busNo=%lu, devNo=%lu",
--
1.8.1.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-07 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-07 12:18 [PATCH 1/2] staging: unisys: unneeded NULL check Sudip Mukherjee
2014-11-07 12:18 ` [PATCH 2/2] staging: unisys: dereferencing NULL pointer Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®