Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1924476pxa; Thu, 6 Aug 2020 21:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCPKocUkI+ZEAQQ8z9EgjtrC9V/Sfg2XS9eOWdyCXSyjJC5T2j8N8mHGM1tVdkwl5u9L8r X-Received: by 2002:a17:906:496:: with SMTP id f22mr7392378eja.180.1596772886576; Thu, 06 Aug 2020 21:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596772886; cv=none; d=google.com; s=arc-20160816; b=dl0pn7W8MQMhOrE4kqVA+2M5QS/k60VdHOf37m6JyQzc+vkc2fDjgV3zBjthgxxrya 6Wk9jOKh7VknvbdKkLu0uR8Zl0T9emQ2gv4Nh0S4La0pUW0Ek+3Y4nFLlCMXvp/LHmqy D+6wkzUXNcd0wTUhqNwdb33NWZA+fSMAV5Xf/wDH0BuUhKzUq3lQRQKRAnAEom5ucx1C KkpOXIHi54bIwpYwNVWAUQBrBLb72xUIBFFj6/mJwToipdRaAk33w1OuSUcrTzST6TWv sF0X8NRv4ntgDnBmX3IyeuJE6H+C9/2oGM9vVGV/6r+mPZaB+fIoy5wNoRaYZxIfuh85 xCHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:to:from:subject:dkim-signature; bh=8ur7u+L4AiUpxBUHlNLWgY5xdw+Rt8MUvqmC6sx75eg=; b=yhXNso6rc6EgV3P1EXtKwRzCDqkNoiqCa6D3U/cA/BH7DSChIS5nYz1zLo8Pd7RlDW XKDXzM/feveVuNubKZoUxJldY976mlTRO4GYZU7y7BzB6kYNwn8TQ/8T4viMNvABnY15 6syliJ2LJPymkjXKMTp2aOviVHtOiZx+Qw+ddBzcrNkhnqyiBIQcfICFNOSHhKZ1H6gA WC/iqqI6yAcKhvAbFrYiIklqrut61gzwIzq6p4OlIM4uOFpAXG/0kxzCTRGDHpxrou6T n9sihkx5v+hWKECVW6Uu1+ldbO6XNeNlOEgr1mRDBvR3bhWanPKN+A3RrENS5tEV7KuU JR/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C1Wf1Kia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz26si4521606ejb.40.2020.08.06.21.01.02; Thu, 06 Aug 2020 21:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C1Wf1Kia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbgHGD7k (ORCPT + 99 others); Thu, 6 Aug 2020 23:59:40 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44780 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726078AbgHGD7j (ORCPT ); Thu, 6 Aug 2020 23:59:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596772778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8ur7u+L4AiUpxBUHlNLWgY5xdw+Rt8MUvqmC6sx75eg=; b=C1Wf1KiawA0CklZxFa+RSXGSeJFePmsb17Oukj7RqAlZ+FpouLdfPFWQTsgtW0FTda+doW OvOfW6zIl9ktjrdOFgzd1J06FokfVbWeyLw3gpPZz+Ez0nIZvInkTMKe7g/QKTFmiL6aR5 Bj9H3iQCwQkDIL7li9BtpU7pVFq4UQM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-eu1zuceKMwaHilGdVSy2Hg-1; Thu, 06 Aug 2020 23:59:36 -0400 X-MC-Unique: eu1zuceKMwaHilGdVSy2Hg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A64318C63DE; Fri, 7 Aug 2020 03:59:35 +0000 (UTC) Received: from [10.72.13.215] (ovpn-13-215.pek2.redhat.com [10.72.13.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9829187A5A; Fri, 7 Aug 2020 03:59:30 +0000 (UTC) Subject: Re: [PATCH] vdpa/mlx5: Fix erroneous null pointer checks From: Jason Wang To: Alex Dewar , "Michael S. Tsirkin" , Parav Pandit , Eli Cohen , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20200806191849.82189-1-alex.dewar90@gmail.com> Message-ID: <59bf7e04-a834-2728-dd2a-a2cd62a724a8@redhat.com> Date: Fri, 7 Aug 2020 11:59:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/7 上午11:37, Jason Wang wrote: > > On 2020/8/7 上午3:18, Alex Dewar wrote: >> In alloc_inout() in net/mlx5_vnet.c, there are a few places where memory >> is allocated to *in and *out, but only the values of in and out are >> null-checked (i.e. there is a missing dereference). Fix this. >> >> Addresses-Coverity: ("CID 1496603: (REVERSE_INULL)") >> Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 >> devices") >> Signed-off-by: Alex Dewar > > > Acked-by: Jason Wang Colin posted something similar: [PATCH][next] vdpa/mlx5: fix memory allocation failure checks And I think his fix is better since it prevent raw pointers to be freed. Thanks