Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbdF0P0X (ORCPT ); Tue, 27 Jun 2017 11:26:23 -0400 Received: from 8bytes.org ([81.169.241.247]:38424 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709AbdF0PSF (ORCPT ); Tue, 27 Jun 2017 11:18:05 -0400 Date: Tue, 27 Jun 2017 17:16:58 +0200 From: Joerg Roedel To: Gerald Schaefer Cc: Sebastian Ott , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, jroedel@suse.de Subject: Re: [PATCH 1/2] iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device() Message-ID: <20170627151658.GY30388@8bytes.org> References: <1497532312-30470-1-git-send-email-joro@8bytes.org> <1497532312-30470-2-git-send-email-joro@8bytes.org> <20170616193301.17cebd11@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170616193301.17cebd11@thinkpad> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 732 Lines: 22 Hi Gerald, sorry for the delay. Answers inline. On Fri, Jun 16, 2017 at 07:33:01PM +0200, Gerald Schaefer wrote: > Seems pretty straightforward, so > Reviewed-by: Gerald Schaefer Thanks, I add it to the patch. > With generic_device_group() returning NULL in case the allocation failed, > this part of iommu_group_get_for_dev() would then happily dereference the > NULL pointer, because IS_ERR(group) would be false: Yeah, you are right, this is a bug. I'll send a patch to fix this shortly. I don't remember whether there was a good reason to drop the error values in the device_group call-backs. Probably there is none and I can just pass the error value up instead of NULLing them out. Joerg