From patchwork Sun Mar 13 00:37:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 8572511 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 99307C0553 for ; Sun, 13 Mar 2016 00:37:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1D24202B8 for ; Sun, 13 Mar 2016 00:37:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C37A20115 for ; Sun, 13 Mar 2016 00:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753693AbcCMAhJ (ORCPT ); Sat, 12 Mar 2016 19:37:09 -0500 Received: from mailout.easymail.ca ([64.68.201.169]:33729 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbcCMAhI (ORCPT ); Sat, 12 Mar 2016 19:37:08 -0500 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 6408DECEF; Sat, 12 Mar 2016 19:37:07 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Score: -3.692 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lJVnHTSKxKWU; Sat, 12 Mar 2016 19:37:07 -0500 (EST) Received: from mail.gonehiking.org (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by mailout.easymail.ca (Postfix) with ESMTPA id E2BB7ECEE; Sat, 12 Mar 2016 19:37:06 -0500 (EST) Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 4C15C9F2E0; Sat, 12 Mar 2016 17:37:06 -0700 (MST) From: Shuah Khan To: mchehab@osg.samsung.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: add dump_stack() if called in atomic context Date: Sat, 12 Mar 2016 17:37:05 -0700 Message-Id: <1457829425-4411-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.5.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change media_add_link() and media_devnode_create() to dump_stack when called in atomic context. Signed-off-by: Shuah Khan Suggested-by: Mauro Carvalho Chehab --- drivers/media/media-entity.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index e95070b..66a5392 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -570,6 +570,9 @@ static struct media_link *media_add_link(struct list_head *head) { struct media_link *link; + if (in_atomic()) + dump_stack(); + link = kzalloc(sizeof(*link), GFP_KERNEL); if (link == NULL) return NULL; @@ -891,6 +894,9 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev, { struct media_intf_devnode *devnode; + if (in_atomic()) + dump_stack(); + devnode = kzalloc(sizeof(*devnode), GFP_KERNEL); if (!devnode) return NULL;