From patchwork Sat Aug 22 19:43:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Samara X-Patchwork-Id: 11732243 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DEE511392 for ; Mon, 24 Aug 2020 06:56:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD5A52067C for ; Mon, 24 Aug 2020 06:56:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E4a7p3u+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD5A52067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A41496EC76; Mon, 24 Aug 2020 06:55:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6EC406E519 for ; Sat, 22 Aug 2020 19:43:23 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id x5so4852399wmi.2 for ; Sat, 22 Aug 2020 12:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bDeHhD/5z6aaFlItq04V8HlPaMZcoXhz68jm6W6MONk=; b=E4a7p3u+k/VHbSDKvo+vWFDgHYz75Y8+NmMpZQGWE5shPjdmZTRi24d7YVdsF6YAFZ zrYn1oTQeDaXMki76OWmSBV9Vyn6OIAazfgRl3Y0NYfr5L1R+JueMY7PulbAUEYYTnHP ae9Ipw2x67GtWT1+eQBwo51wObjS5xBprbcXr5Dk6a7ZvOmo8xGQzaJpAGeuS5F/Bakt W2r1VFpkF83+xZm5nurZsceL67OmWE3bi/pV6mNiCNI0Ok94JeIWh2+8BeX5Zs6ltUDK chaMncvuVVyxcbzBUTXB2oy0iwh0lEjDBuVexS9xnCBznQ715CgWQ+2HK3ir/iMCELyV jBzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bDeHhD/5z6aaFlItq04V8HlPaMZcoXhz68jm6W6MONk=; b=h53iioIdvFTHk4KccdWwTjn5EPFTsg9+9+l0Ny+6VNAOJ2hEkeVoyAaOUTKmccFVno YlH2Yg3g8a+BOSf71kebTJnQam7t7N2PUk7HU/GIgkwqoWaUdKgNqOacA82ABUCOQIAW zvnNE01GvM7XbW1GL7VqvD463CAYXhnSG9PTbmgHV6N3N0LDylw1HqdRXeA+aVPT2t+D 3uKr1ZpEgW95KFTCRxKDoOD5zRIqUoDaaKtPRdl9fP4o0k/p97YThXPFvl7Zhg516AAS bUuZxtR6EKTk0agpWuYC6TIfG3Uwm2yqlh1C6BEzhmvNuI1ZhT8SxSNlfyBoULsqKG/y PPhA== X-Gm-Message-State: AOAM530FvfpAvO9xpdSBedYjRaHiNRJkGIMFF3erm1y2msfXCrVTS0iu JK+pCFOU8nKlJrzUg4m6scs= X-Google-Smtp-Source: ABdhPJwnnkIT5/uCftHhMXqn1D4NcYSiQuuoKXX9omd0RYEa9lVbqCbaGzyn1xpBO11hX4gU7y3p3w== X-Received: by 2002:a1c:28d5:: with SMTP id o204mr9837747wmo.104.1598125402082; Sat, 22 Aug 2020 12:43:22 -0700 (PDT) Received: from tsnow (IGLD-83-130-62-237.inter.net.il. [83.130.62.237]) by smtp.gmail.com with ESMTPSA id z12sm12968394wrp.20.2020.08.22.12.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Aug 2020 12:43:21 -0700 (PDT) Date: Sat, 22 Aug 2020 22:43:02 +0300 From: Tomer Samara To: Greg Kroah-Hartman Subject: [PATCH v5 1/2] staging: android: Remove BUG_ON from ion_page_pool.c Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Mon, 24 Aug 2020 06:55:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Todd Kjos , Suren Baghdasaryan , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hridya Valsaraju , Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= , Joel Fernandes , Laura Abbott , Martijn Coenen , Christian Brauner Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" BUG_ON() is removed at ion_page_pool.c Fixes the following issue: Avoid crashing the kernel - try using WARN_ON & recovery code ratherthan BUG() or BUG_ON(). Signed-off-by: Tomer Samara --- drivers/staging/android/ion/ion_page_pool.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index 0198b886d906..fa764299f004 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -46,11 +46,9 @@ static struct page *ion_page_pool_remove(struct ion_page_pool *pool, bool high) struct page *page; if (high) { - BUG_ON(!pool->high_count); page = list_first_entry(&pool->high_items, struct page, lru); pool->high_count--; } else { - BUG_ON(!pool->low_count); page = list_first_entry(&pool->low_items, struct page, lru); pool->low_count--; } @@ -65,8 +63,6 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool) { struct page *page = NULL; - BUG_ON(!pool); - mutex_lock(&pool->mutex); if (pool->high_count) page = ion_page_pool_remove(pool, true); @@ -82,8 +78,6 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool) void ion_page_pool_free(struct ion_page_pool *pool, struct page *page) { - BUG_ON(pool->order != compound_order(page)); - ion_page_pool_add(pool, page); } From patchwork Sat Aug 22 19:43:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Samara X-Patchwork-Id: 11732251 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09D591392 for ; Mon, 24 Aug 2020 06:56:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC68D2067C for ; Mon, 24 Aug 2020 06:56:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="afpLZoVb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC68D2067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 411F66EC70; Mon, 24 Aug 2020 06:55:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4523B6E519 for ; Sat, 22 Aug 2020 19:44:04 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id l2so4941311wrc.7 for ; Sat, 22 Aug 2020 12:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+y66MqggCakjVuRG4cFz30VjWieYM9CuDcuOFxkR0Z0=; b=afpLZoVb9S8UX5sZ9/41+hXwLGbgiEtiHOm6f0p2P8Oh3Af7Yx/no4zrBKzKnt0F0f PPIT2K/9GZAWs+wbhuu+TJwBZ6LEfRYnHvZkTfv64n7pZrcffX0YS/x5cTaijqlkLzZP mKJR9PFZG+yGLfMKAMdJc1mackvLjGEjbz/zDBoz0qUeFGlQwPfhnSoiwq8//Z9UlFNn O/MvoekqmF7B2xPoXRW2cYPtM3YApr7keQHyrArRZHDI2VQmH060XReevrwNCxSlfr9i GY9+091wIX9sfA+wZSOhUMdgB7fs5OKUTLNqWZBlqnGeandc5Snv8rrJU3MZk9+ODRaa qQgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+y66MqggCakjVuRG4cFz30VjWieYM9CuDcuOFxkR0Z0=; b=t6/3nd+GuNTyIK7Qjh7wXfAN903w/53tzCPe3X4pbBeeKl+YiyqRhF0y6opscMmKLI LbbFNyfiMjYe+G1YcNKq+bRG+wAA8unpcCYWDrW2/8udDPhyh1c7YhNTNpo5PSSkHxVP 4VlOpip5lIeaDZgfGFvVcBOeS55q2Z0B+LCrh0Euonb0kuAbM2di6Ta9xWDqZVCgSCQV 89PUCcQJp4oAIyYXwmAwDgsKRhQllXeLfYFuMfo9b9O6OK2/BDs7TNjjUQMEii+00jhk P+DB1qotm7AiCOy3ai+J2aYeBuzIRYdEmJSPBd28oL7v++nxsFoRAJhxml8rAFoT38iE zERg== X-Gm-Message-State: AOAM5313mv2VKZkAIS2FqaipK4oaD8AAs4XEJqlcCBnfi+3glnFBT/y+ A2LtYlfRk6ARmT2n6T8DF9M= X-Google-Smtp-Source: ABdhPJwt5n+lLcPAY7wmuVOEPNfgK98a5ZJcSYZj6v5ca19sNHLgGR7JEhitIeLWdduX+y2ESbJtEg== X-Received: by 2002:a5d:5485:: with SMTP id h5mr3181435wrv.247.1598125442919; Sat, 22 Aug 2020 12:44:02 -0700 (PDT) Received: from tsnow (IGLD-83-130-62-237.inter.net.il. [83.130.62.237]) by smtp.gmail.com with ESMTPSA id k7sm3692908wrv.72.2020.08.22.12.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Aug 2020 12:44:02 -0700 (PDT) Date: Sat, 22 Aug 2020 22:43:50 +0300 From: Tomer Samara To: Greg Kroah-Hartman Subject: [PATCH v5 2/2] staging: android: Remove BUG from ion_system_heap.c Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Mon, 24 Aug 2020 06:55:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Todd Kjos , Suren Baghdasaryan , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hridya Valsaraju , Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= , Joel Fernandes , Laura Abbott , Martijn Coenen , Christian Brauner Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Remove BUG() from ion_sytem_heap.c this fix the following checkpatch issue: Avoid crashing the kernel - try using WARN_ON & recovery code ratherthan BUG() or BUG_ON(). Signed-off-by: Tomer Samara --- drivers/staging/android/ion/ion_system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index eac0632ab4e8..00d6154aec34 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -30,7 +30,7 @@ static int order_to_index(unsigned int order) for (i = 0; i < NUM_ORDERS; i++) if (order == orders[i]) return i; - BUG(); + /* This is impossible. */ return -1; }