[PATCH 10/10] staging: unisys: visorbus: Clarify reason for device pointer checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: David Binder <david.binder@xxxxxxxxxx>

Clarifies why the pointers returned from visorbus_get_device_by_id() in
visorbus are validated. The check is performed in order to be extra
careful, for the sake of added security, that the s-Par backend is
providing us with a valid device.

Signed-off-by: David Binder <david.binder@xxxxxxxxxx>
Signed-off-by: David Kershner <david.kershner@xxxxxxxxxx>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 188e224..07f8d05 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -897,6 +897,7 @@ my_device_changestate(struct controlvm_message *inmsg)
 	int err;
 
 	dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL);
+	/* Validate that s-Par backend gave a good device */
 	if (!dev_info) {
 		POSTCODE_LINUX(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 			       DIAG_SEVERITY_ERR);
@@ -957,6 +958,7 @@ my_device_destroy(struct controlvm_message *inmsg)
 	int err;
 
 	dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL);
+	/* Validate that s-Par backend gave a good device */
 	if (!dev_info) {
 		err = -ENODEV;
 		goto err_respond;
-- 
git-series 0.9.1
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux