Message ID | 1533062586-804-4-git-send-email-amit.pundir@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5670714ljj; Tue, 31 Jul 2018 11:43:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcsLLuu6AAPszlngzbIEVRqNNduvAocDQf2Fhy5sdmOBSNmdLcq8boYAbNGqhCojUPMVlUG X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr23432491pfo.132.1533062601528; Tue, 31 Jul 2018 11:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533062601; cv=none; d=google.com; s=arc-20160816; b=N0OgLjm7UUaVi8RNDQzS2LW7F7ch7BZKfmh5LZjs2yHqleLI2tYXZv9E6Mr6j0HC7e VQkHPykS86QA/D7xnA1NZqeurTBI3ieksye4S5Z7zrY+TpwuvSkx67Ov9BHWYMzKBMQU VWgJUBzAfdENZjNCN1dY5V+a41j6JLDnCMVDDSLwTwfE0ZF6XKoUxlNqmmCiFDgeCZE7 dlTM9hlFy633lXElWWMjYkeQU8+RamHiavwn3KrGXcxPMUZtDM8mFgUoSM38b0q4BSdq NT++JOZsvwUD66Sqa6G7qYvGcNi+s4aSqvtRLLZYXSY3PAxat3NR2AtFmqLpRKZIMPRj 9+NA== 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=uiu+Up9g8NpjQ1GxElDZ8A5YGS2tl5X4Nfj76Edx10V6SnxUmdpE28dF91cacSzJbu oCrYU6iqACCpgr3aDNFX2PUm1UglwaVhpcvds8nA8NiBqD/fY9N01nKBjBSp/+KCOc80 V69bYA0QFkBNdEzSHZHick2AeKI3dkbQDuCCsGbZI0QwpHTjh5ftHNr6VzVXR+2nAzMe Fsc8ici2VrFyY5iaOnbdnqenrGqpsbfqWJtrjPyFmTtaCTaHS0HGSQLMfAUuiOyIb8ks XVT3van6+sObS07Upcj4CvpbGohJ2T1ZMmMzM/8/8LzYPtSI1eQu8prfHZYuWmItR1Zy TiEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jCV8bmQW; 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 t71-v6si13085197pgd.271.2018.07.31.11.43.21; Tue, 31 Jul 2018 11:43:21 -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=jCV8bmQW; 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 S1731021AbeGaUY4 (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Tue, 31 Jul 2018 16:24:56 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42978 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729772AbeGaUY4 (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 31 Jul 2018 16:24:56 -0400 Received: by mail-pg1-f193.google.com with SMTP id y4-v6so9505406pgp.9 for <stable@vger.kernel.org>; Tue, 31 Jul 2018 11:43:19 -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=jCV8bmQWZyAD+WfBVlxQh13voqiYi7A0oClx/OwQnhjdstNmf8xpDHB/3mP9GfBKzj JNS0ZDlk7mLaMkEt3kyFoRMajYDvmnwlTcL6jEc+zMnW4IwKqFNXdQMgReNSslzE7Twj ccis9N1q3g07BOKQPmgTfpRUm0nSTODZC9nFU= 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=rqQXRsOJvHsVjlnk3lDn439n15Jz1MjwYR1SOMyJzfPN70GUzBhA0jwK3HVUv9eRmo 2iqXaT6sK6u1Kl7tARgDjwE+IijXeJY/72DMgazknJqXeir2z1ItVSIypyieiUzI9hfg pL5km5WdoAVXs3p9f4Q0f3VSjYW+Fq/qCC+58eiV5awZcF2O9RjmCKbGw12h0wZgeYdJ oiBX5Gy1EAPtpHqM35pZvBgr5lq28AeP99m32RsYkxMtTxodxNWx6W1nC95Ih0VI621U upjQ8UYoB1MM7Pj6YlODGCS0C/FQJ2RbLtGwdEF3ELTVzXwzd2TpzNngtJqBYBJfswni YWBg== X-Gm-Message-State: AOUpUlGGkkUb5EoqMvHbxlMopbeQ8RFJJ6oJQqoW8+HbB9ocGLZ4ycuY BTNCVxoQY5mTVirbjeW1OE0uiA== X-Received: by 2002:a63:fd52:: with SMTP id m18-v6mr16769483pgj.304.1533062599327; Tue, 31 Jul 2018 11:43:19 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id v22-v6sm38486956pfi.60.2018.07.31.11.43.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 11:43:18 -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 for-4.4.y 3/5] sch_hhf: fix null pointer dereference on init failure Date: Wed, 1 Aug 2018 00:13:04 +0530 Message-Id: <1533062586-804-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533062586-804-1-git-send-email-amit.pundir@linaro.org> References: <1533062586-804-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];