From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 1/2] iommu/s390: Use iommu_group_get_for_dev() in s390_iommu_add_device() Date: Tue, 27 Jun 2017 17:16:58 +0200 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-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170616193301.17cebd11@thinkpad> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Gerald Schaefer Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, jroedel-l3A5Bk7waGM@public.gmane.org, Sebastian Ott , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org 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