mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
mei: protect mei_cl_mtu from null dereference
commit bcbc0b2e27
upstream.
A receive callback is queued while the client is still connected
but can still be called after the client was disconnected. Upon
disconnect cl->me_cl is set to NULL, hence we need to check
that ME client is not-NULL in mei_cl_mtu to avoid
null dereference.
Cc: <stable@vger.kernel.org>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20201029095444.957924-2-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7bd625c9b3
commit
8af347892a
1 changed files with 2 additions and 2 deletions
|
@ -138,11 +138,11 @@ static inline u8 mei_cl_me_id(const struct mei_cl *cl)
|
|||
*
|
||||
* @cl: host client
|
||||
*
|
||||
* Return: mtu
|
||||
* Return: mtu or 0 if client is not connected
|
||||
*/
|
||||
static inline size_t mei_cl_mtu(const struct mei_cl *cl)
|
||||
{
|
||||
return cl->me_cl->props.max_msg_length;
|
||||
return cl->me_cl ? cl->me_cl->props.max_msg_length : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue