Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754456AbbDTUty (ORCPT ); Mon, 20 Apr 2015 16:49:54 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:34149 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754274AbbDTUtv (ORCPT ); Mon, 20 Apr 2015 16:49:51 -0400 MIME-Version: 1.0 In-Reply-To: <20150420203645.GE20701@google.com> References: <1429546972-28400-1-git-send-email-ricardo.ribalda@gmail.com> <20150420192844.GD20701@google.com> <20150420203645.GE20701@google.com> From: Ricardo Ribalda Delgado Date: Mon, 20 Apr 2015 22:49:28 +0200 Message-ID: Subject: Re: [PATCH] kernel/resource: Invalid memory access in __release_resource To: Bjorn Helgaas Cc: Andrew Morton , Vivek Goyal , Vinod Koul , Cliff Wickman , Jiang Liu , Jakub Sitnicki , Thierry Reding , Mike Travis , LKML , Grant Likely Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1200 Lines: 34 Hello On Mon, Apr 20, 2015 at 10:36 PM, Bjorn Helgaas wrote: >> > From reading drivers/base/platform.c, it looks like the intent is >> > that platform device users would use these interfaces: >> >> I can take a look to modify OF to use insert_resource(), but I still >> think that no matter what, we should add this extra check, like the >> propossed patch or maybe with a BUG_ON().... > > I think it would be nicer to make OF use platform_device_add_resources() > and platform_device_add() because then there's less duplication of code. > But Grant might have had a reason for avoiding that. > > Bjorn I think I am going to make two patches, one modifying OF as you suggest, and another one adding a BUG_ON to release_resource. Then you can decide to apply one or two with the feedback from Grant I have no hardware to test it right now, but tomorrow morning I can test the patches and send them. Thanks! -- Ricardo Ribalda -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/