Received: by 10.192.165.148 with SMTP id m20csp5191761imm; Tue, 24 Apr 2018 15:37:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx49noqSNNJ3S97FAufyzYcxpV0KlcRBZU424VyIUDUKdqb2Ns1d5kieiUxwl0DxMue+Ko8J4 X-Received: by 2002:a17:902:c24:: with SMTP id 33-v6mr26063634pls.88.1524609466454; Tue, 24 Apr 2018 15:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524609466; cv=none; d=google.com; s=arc-20160816; b=HP7cIMP62xh+wh5BpeS9U3vssw+ZKDKbmGTHUPYFWhWMnU76izQARGjj/ybFWi/8pl mJ70c1TlD9+mk3xU5IKlapRECRjUDFnB3bMGFkUm/wyIjcEQbTnzI+D0A2JN//28MJlI xwSfGqtdg/2WRV6XVDQEZVNKLuFYUCaI0sp1o39JY5Slz58rMgWAfUomnj+u5EP4NPih bR3YETlu01l2JPfWqbP+58ReW1m7/tINnzcOXPyVBPWK7Mn23iDN4Adtq3WKTgPKfNXU tdENyrO+4x+DzzkRvleNbnovZXPaHYsEEEgQsENBwpZ0GtVmpzMt46PA7DqEoDRHetO6 ia+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature :arc-authentication-results; bh=ueRmdzKY9bt20v2Z0ad/8ra/P7twn3YmUAHw0RSFmKY=; b=z1mPfaS/xa4k1AO7S61HG3uA0abz3zFwbodW+eIYrT9xGpujeN2yc/GpjxRQ2j9Zk2 aNr1sVjsWUHDd2WO5GRpcUkgpSyUCQN8fHQ6Nkc8kI6+oXws58t1+irphAAV/9zrgnAd CUioSc1ABLWh0DHPsThtZsEAEkITEE0RFYH13pNhD72+GHSGKQ3aV3sq9zfEvTUr6EyE kUhr4xVEOBo3LFp95zU5yJcvlGTAEALv0MoGVq1W5LGmhfJ3U5zfG5zWgBM1GNGV3Neu Pq59pC3+bDxPw/MD5XGCdF5kkTq//TGT2EyIA5EW879YQyvKGXCSVU4GvXVZtVs7som3 a6dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=vBkO0b0O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si6555711pla.194.2018.04.24.15.37.32; Tue, 24 Apr 2018 15:37:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=vBkO0b0O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbeDXWgE (ORCPT + 99 others); Tue, 24 Apr 2018 18:36:04 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:36382 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbeDXWf6 (ORCPT ); Tue, 24 Apr 2018 18:35:58 -0400 Received: by mail-lf0-f42.google.com with SMTP id d20-v6so22660221lfe.3 for ; Tue, 24 Apr 2018 15:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ueRmdzKY9bt20v2Z0ad/8ra/P7twn3YmUAHw0RSFmKY=; b=vBkO0b0OXSW3duL8XHBWcLisud3MipTCX2F9QggbqKsd2G+NTXo6X9DcCeiitlqAAO ig1ncIARauzP0m6Gg4ihGxKD9ohfSKCeWVv0GzLth3l9zscRVmuUGVgZjoJSEU9uHOJZ BuKmjhJ9cr4zk3v61XGsC8f1WBXlp7jWMpQ3iHULydevzqPdp3iJ1b6nOyIeToiH7bQE j5ZrsuTE659CZkjxzOxE774F0HsmEjdeLtjST5kEsFnQfciIoaCFX8FUIOTfrp6TYp6o loPvna98L22BgM3oEzHASUzXQKhBINlT5Y3bk1E/M7R5noTf5c7PIwgE5GIyDsuFa9F6 c+RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=ueRmdzKY9bt20v2Z0ad/8ra/P7twn3YmUAHw0RSFmKY=; b=CBlnsBNlSNPCyKDaryzcyghDA3mTBJw4q6zxygJyrqKBlmOWqZTGHLpchwbzHTyb9Y uiDEIyNMfhcLyMCzM4tiPCTwdXKw71TJjQCvYXCd0QDExC+vOrJatWqFONS4wGp3DO0W rqGmUrLunFYqDaryjXo+WtiJ3vLDXQbplqMUKwumLm4he0yyMaUI4HhS0FN3+SZVxS62 B5r/2ASG1wgAItXMORiZ7FgxYp4Ly7dp3vFP/ZWeP7hQBPdAggBghjwfiFXmtPJqBw70 6Bjr2T2a/xo25ETcnI+lbquhdInMii+Vcgo/EsHjq8U9dSj/O8MMo+HoCDMjc6yNtfKp zVig== X-Gm-Message-State: ALQs6tCz6b+CVtxbICWGijnw9ee1bOyG3Rr/07GqukqWlizyG8HRONdE EF0+CmkTQgQa2KwwT8jQSVY0o+Zj X-Received: by 2002:a19:ed09:: with SMTP id y9-v6mr12188450lfy.25.1524609356913; Tue, 24 Apr 2018 15:35:56 -0700 (PDT) Received: from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99]) by smtp.gmail.com with ESMTPSA id p28sm2979558lje.69.2018.04.24.15.35.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 15:35:55 -0700 (PDT) From: "Niklas =?iso-8859-1?Q?S=F6derlund?=" X-Google-Original-From: Niklas =?iso-8859-1?Q?S=F6derlund?= Date: Wed, 25 Apr 2018 00:35:54 +0200 To: Colin Ian King Cc: Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , "linux-kernel@vger.kernel.org" Subject: Re: media: rcar-vin: add group allocator functions Message-ID: <20180424223554.GE27674@bigcity.dyn.berto.se> References: <12ca5ca8-a582-5899-6dd5-c064e4b54e2b@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12ca5ca8-a582-5899-6dd5-c064e4b54e2b@canonical.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Colin, Thanks for reporting this. I wonder why smatch and sparse did not catch this, the fault can't be mine for writing such a obviously bad thing right :-) I have a patch to address this, just need to test it before posting. On 2018-04-24 14:14:02 +0100, Colin Ian King wrote: > Hi there, > > While running static analysis on linux-next today a null pointer > dereference issue was detected by CoverityScan. The following commit > introduced the issue: > > commit 3bb4c3bc85bf77a76c921671800bde2e1bf82a88 > Author: Niklas S?derlund > Date: Sat Apr 14 07:57:18 2018 -0400 > > media: rcar-vin: add group allocator functions > > The analysis is as follows: > > 339 static void rvin_group_put(struct rvin_dev *vin) > 340 { > 341 mutex_lock(&vin->group->lock); > 342 > 1. assign_zero: Assigning: vin->group = NULL. > > 343 vin->group = NULL; > 344 vin->v4l2_dev.mdev = NULL; > 345 > CID 1468359 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) > 2. var_deref_op: Dereferencing null pointer vin->group. > > 346 if (WARN_ON(vin->group->vin[vin->id] != vin)) > 347 goto out; > 348 > > vin->group is NULL however the WARN_ON is dereferencing it, causing an > OOPS. I don't know how this should be fixed, hence I am sending this > bug report. > > Regards, > > Colin -- Regards, Niklas S?derlund