Commit fa4cfedf authored by Mamta Shukla's avatar Mamta Shukla

sw: drv: Add condition to check Invaid VME dev

A NULL check condition is added to warn about uninitialized and invalid
vme device.
Signed-off-by: Mamta Shukla's avatarMamta Shukla <mamta.ramendra.shukla@cern.ch>
Suggested-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 255529ba
......@@ -30,7 +30,7 @@
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/fpga/fpga-mgr.h>
#include <vmebus.h>
#include "vmebus.h"
#include "svec.h"
#include "svec-compat.h"
......@@ -528,6 +528,9 @@ static int svec_probe(struct device *dev, unsigned int ndev)
struct svec_dev *svec;
int err;
if (WARN(dev == NULL, "Invalid VME Device\n"))
return -1;
svec = kzalloc(sizeof(struct svec_dev), GFP_KERNEL);
if (!svec) {
err = -ENOMEM;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment