qos: Add NULL checking for irq descriptor

Check for NULL for irq descriptor to prevent deferencing an invalid
address.  The qos value is then ignored as it cannot be associated with
the requested irq.

Change-Id: I82fdc9b10ffff89032a0f0e9dade42e4c670f4b9
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
This commit is contained in:
Mahesh Sivasubramanian 2017-01-31 14:26:12 -07:00
parent 3a7e752617
commit 466165aa64

View file

@ -597,7 +597,11 @@ void pm_qos_add_request(struct pm_qos_request *req,
case PM_QOS_REQ_AFFINE_IRQ:
if (irq_can_set_affinity(req->irq)) {
struct irq_desc *desc = irq_to_desc(req->irq);
struct cpumask *mask = desc->irq_data.common->affinity;
struct cpumask *mask;
if (!desc)
return;
mask = desc->irq_data.common->affinity;
/* Get the current affinity */
cpumask_copy(&req->cpus_affine, mask);