From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RDNS_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org ([198.145.29.99]:59160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730019AbgCKQO0 (ORCPT ); Wed, 11 Mar 2020 12:14:26 -0400 Date: Wed, 11 Mar 2020 17:14:23 +0100 From: Greg KH To: Christoph Hellwig Cc: torvalds@linux-foundation.org, aros@gmx.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH] device core: fix dma_mask handling in platform_device_register_full Message-ID: <20200311161423.GA3941932@kroah.com> References: <20200311160710.376090-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311160710.376090-1-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Mar 11, 2020 at 05:07:10PM +0100, Christoph Hellwig wrote: > Ever since the generic platform device code started allocating DMA masks > itself the code to allocate and leak a private DMA mask in > platform_device_register_full has been superflous. More so the fact that > it unconditionally frees the DMA mask allocation in the failure path > can lead to slab corruption if the function fails later on for a device > where it didn't allocate the mask. Just remove the offending code. > > Fixes: cdfee5623290 ("driver core: initialize a default DMA mask for platform device") > Reported-by: Artem S. Tashkinov > Tested-by: Artem S. Tashkinov No s-o-b from you? :( I can take this, or Linus, you can take this now if you want to as well: Reviewed-by: Greg Kroah-Hartman