Message ID | 1535007116-31801-4-git-send-email-amit.pundir@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:164a:0:0:0:0:0 with SMTP id 10-v6csp757662ljw; Wed, 22 Aug 2018 23:52:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxUUSSMlfuVNvN7OiOXjYknQFwnqQUv1EgYl9KcWqa7jjV8CbqWOjyso+nD6pRxjO5qtrfr X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr56002591plb.176.1535007130609; Wed, 22 Aug 2018 23:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535007130; cv=none; d=google.com; s=arc-20160816; b=Ql1Cf+SQnrALDvAsFcrragLKVJwF1hT7RnEZYbv8Q0YHhufxOqrOIGX/OdLmP8mfeb kTsOnt4G+knzhJFVkL9ZYWZlHbrO73Zji7v2M7XRmdRJd/M6td+Kf8n+vK32OEqYIJPU yzsNG4k8NVP1XwL2XSZdYM6tuN9GZagtvU1+SDcC1KpnzeYYzngXFtyN77mZn2MJxHmU Wlqwkn+nMKGXHpNBnpyeIjm41NZmg8paKw4OeaY9wVV5UCFd1KCmFRvMbMGZJUkSZ9Y2 hzlEJKDhrKENk3f9sqaEmda8yYQoIap7rFpa87gzvwOgbwggFBGgtvrS1e5/a5K2oAV2 DRHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8EvYZpG55yMb3RV9RLTPZQQ0d3uJk4fPbb/sOy7Qi1k=; b=GASRK4XY9bknyfmuP6WJcYtqAKuWmYcNqJGHePP+VVSwmBxC7zfzp9nQmVDJNZ7RjM qMQNgdvERvTUpcVKyaRinnIWvZ3/CP9Tia2GXUcbUPdfB3rmbX95FnzGPTeEsFXeb13u TRBnF8IfZ/+anltZSiNbSXvwCazrb+09KTBL/s3jxdbNt7/y/eFDT1UPH5EzTfpmUSvh cl//DfsLRswisGsrmUYf7g3ocOYtsTvhzi881ZkrVTx9kq371r/wzs7aRWlRFp6uWvad 2sZRJiDnkv+9E8MRYfYm6UVIgItt1IWQvpq0/R8pj49p2VRZbAvo4tYtoBRVaCZzKEzO QENw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c+ySGmhS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf13-v6si3685258plb.334.2018.08.22.23.52.10; Wed, 22 Aug 2018 23:52:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c+ySGmhS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbeHWKUT (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Thu, 23 Aug 2018 06:20:19 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45962 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbeHWKUS (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 23 Aug 2018 06:20:18 -0400 Received: by mail-pg1-f196.google.com with SMTP id m4-v6so1571485pgv.12 for <stable@vger.kernel.org>; Wed, 22 Aug 2018 23:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8EvYZpG55yMb3RV9RLTPZQQ0d3uJk4fPbb/sOy7Qi1k=; b=c+ySGmhSDWz/mv8Su8XclnV8sN1vSaEFZDPeshA8mXJdadzT3bwyEaxtdVt3Hyde7w ookkfKjn/5lyy1nPHpjE276zNNHnbM4bn57NTW0u8v1Y/xU5CAPqzNi6aU9qAeDIDTIr 5WYmBv5JKcfYaZjVJRe0C4J6hGPREBhVY3Hl0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8EvYZpG55yMb3RV9RLTPZQQ0d3uJk4fPbb/sOy7Qi1k=; b=BsO8TVJ/Ytt/XCLWR75aE3FhT4c5cksDFetLGc6FA52YUMoFO1F5Z4i0twYDuFkZpV U5TZ8Td7S4zlRXQYALSc9mfnFe/qFtEAyV3bjZFpAtdVvP/htssApuaxDtYpNN+7AzlN Q2dOcav28r5gOp0Q2Kje4vPTD9cWD+xfeZ1NE4KVQbWBjjK63gqIXUOO9+RJePT3iiE+ mA35S/2tKeja3y3kelYPXNl8kSLDB5BLw1v5I977SqkHPlVauifRBF15/e9cA1tIlOiA Yz2yZoLYGkWsPTxeGFUr+/UWGE1YSgiWmzjVTe7iI5A/NX3BKQjy65DDFptESyo0vi5R VKBQ== X-Gm-Message-State: AOUpUlE8tV8MlqPo88foPSMm3WYt2nPd81prnKZjxodu8CUwxNQp2LGU 9vY3Yt3un2nlOEMgSYSKYIrvLA== X-Received: by 2002:a63:454d:: with SMTP id u13-v6mr12503042pgk.342.1535007129115; Wed, 22 Aug 2018 23:52:09 -0700 (PDT) Received: from localhost.localdomain ([49.207.48.21]) by smtp.gmail.com with ESMTPSA id d132-v6sm7559932pgc.93.2018.08.22.23.52.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Aug 2018 23:52:07 -0700 (PDT) From: Amit Pundir <amit.pundir@linaro.org> To: Greg KH <gregkh@linuxfoundation.org>, Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Cc: "David S . Miller" <davem@davemloft.net>, Stable <stable@vger.kernel.org> Subject: [PATCH v2 for-4.4.y 3/5] sch_hhf: fix null pointer dereference on init failure Date: Thu, 23 Aug 2018 12:21:54 +0530 Message-Id: <1535007116-31801-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535007116-31801-1-git-send-email-amit.pundir@linaro.org> References: <1535007116-31801-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
net/sched: init failure fixes
|
expand
|
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c index 45d4b2f22f62..aff2a1b46f7f 100644 --- a/net/sched/sch_hhf.c +++ b/net/sched/sch_hhf.c @@ -501,6 +501,9 @@ static void hhf_destroy(struct Qdisc *sch) hhf_free(q->hhf_valid_bits[i]); } + if (!q->hh_flows) + return; + for (i = 0; i < HH_FLOWS_CNT; i++) { struct hh_flow_state *flow, *next; struct list_head *head = &q->hh_flows[i];