[PATCH] staging: gpib: Add missing check for NULL

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

 



This was detected by Coverity, CID 1600787

Signed-off-by: Kees Bakker <kees@xxxxxxxxxxxx>
---
 drivers/staging/gpib/common/gpib_os.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index d5860a0a131f..57ff1ed30dac 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -1667,6 +1667,8 @@ static int autospoll_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv,
 		return -EFAULT;
 
 	desc = handle_to_descriptor(file_priv, 0); /* board handle is 0 */
+	if (!desc)
+		return -EINVAL;
 
 	if (enable) {
 		if (!desc->autopoll_enabled) {
-- 
2.47.0





[Index of Archives]     [Linux Driver Development]     [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