dm: mei: check return value of vmei_host_client_to_vmei()
vmei_host_client_to_vmei() may return NULL we need to check for the return value. Tracked-On: #1630 Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
This commit is contained in:
parent
b4fbef4659
commit
5f41d4a8d3
|
@ -962,6 +962,9 @@ vmei_host_client_native_connect(struct vmei_host_client *hclient)
|
|||
struct vmei_me_client *mclient;
|
||||
struct mei_connect_client_data_vtag connection_data;
|
||||
|
||||
if (!vmei)
|
||||
return MEI_HBM_REJECTED;
|
||||
|
||||
mclient = hclient->mclient;
|
||||
|
||||
/* open mei node */
|
||||
|
@ -1637,6 +1640,9 @@ vmei_host_client_native_read(struct vmei_host_client *hclient)
|
|||
struct virtio_mei *vmei = vmei_host_client_to_vmei(hclient);
|
||||
ssize_t len;
|
||||
|
||||
if (!vmei)
|
||||
return -1;
|
||||
|
||||
if (hclient->client_fd < 0) {
|
||||
HCL_WARN(hclient, "RX: invalid client fd\n");
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue