Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2333351imm; Sat, 9 Jun 2018 12:50:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJgVSZysHzLszNIGiW22K6lxl9gayqF4CHIHckcU2LrDWyfysP4aItDKuAHeHlV/BIN0HH/ X-Received: by 2002:a62:701:: with SMTP id b1-v6mr11278936pfd.252.1528573845273; Sat, 09 Jun 2018 12:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528573845; cv=none; d=google.com; s=arc-20160816; b=tvjaMCg48EUpKyM/nebeMSepuoSfyaGxKY9cFhus8yDr4s5aw/MoinGWOoA0EBU/ug Fp0EU4yS005On4kkAoaFtmwywLASRTUAcPczfCv9RMl6dI/H76MjGTN7tcEdzkOYa6dE s0UGa7xNABJbWgURiObO/hr/drf0RRPImadA4Y7DBMbfHmIQztxMWrMC2z35d17vKysD sSj0vgvSOaFy2KTltT0ZF2m0uR8rAZUd5NVujMCMrpeKOb+8lKXaM6RsZXEVzjPQrkpo Wp9iWq0T2IXZZ9jp03kvQ6ikcI0T4T5RqrFQkeZP85iVt9O65phiVO7P1YV+0DWhojZL dBNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=kDW+NgGTNSxZVvWlzcqwPttXkR6x/1kngTaVgBWnfTw=; b=odZ+181b4Z2vsw/HcdmQ1l01E0IS163fbVFgudPWuH1X6mKVSu0XBEAps4cHRCwufm 0xLe1gmRudJDNZ2vgnuL9peOPVicgRsA+/FfNL8on8+PSFDY5EfawXVN1p3HBNwWYuva 1P8FrVfxUWWwAhgqGVv8H7bqHwJ4LCLKtkz/szluKTLRFhhd52UgXq1Qu3BkMtjj9H+j ZAPe+OpD4x1jhkgAeikxxyyNYvDk3tUcFFhv64L+oYKCDqeUXm8dFjJmB/GfcuYAIjCy Oc8tL1lY9V8s5b2OnaRjNTTIzDZ6Ugob26dnZJZYzooJwLZiTmXROeGPbwDnsGYxWjXT vsfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PSnRzrsd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si22086673pli.45.2018.06.09.12.50.19; Sat, 09 Jun 2018 12:50:45 -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=@gmail.com header.s=20161025 header.b=PSnRzrsd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971AbeFITeq (ORCPT + 99 others); Sat, 9 Jun 2018 15:34:46 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:35392 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbeFITep (ORCPT ); Sat, 9 Jun 2018 15:34:45 -0400 Received: by mail-ua0-f194.google.com with SMTP id s13-v6so7621808uad.2 for ; Sat, 09 Jun 2018 12:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kDW+NgGTNSxZVvWlzcqwPttXkR6x/1kngTaVgBWnfTw=; b=PSnRzrsdOtlGN7K1n8FiSH9PC31fzlYtwk1PGv2tROEiQAXN85d5QWDVxTJGquFREp Iwk/qrribbsEYD41EAyjcS2K/6Gl/Bbd19LLL3K18c5jaXXvdp/50fzCCAUwyDC73XpU W/wCyYvcMfkltsszm4uDcEABewjYyH3TlhKnUePTbQFvVlghUo0BDLtRJpPKYS6FHDjh pA8fvBoSfmWuKgaBf4fIy/oXt/UK15jQEy1TchH3Hko4Rl3VyIr/WBuOfpUEYp2rp8/u C1S4RDsO07dMJTxZwQa5lXGLtBHhA2Hj/+vznXIbyQCHD6tntbAjynM77jPssE8eQ+Tz yqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kDW+NgGTNSxZVvWlzcqwPttXkR6x/1kngTaVgBWnfTw=; b=IizCI8MgudeA2fo6q4G54Jwx8neiRrB1Ti011cYYgXHkec5zloFGO0l65IPGTDw3nx D9sa4H/mmwru0n+6NBev2Fe/W5FivHBAm+Yn5EpnoObK3N8y4iq3d63eF75MluFG66sr DNCgyXuykNkWiAH7dAZXiFn3ymFwivHZwDFJ9tPKzY0e+9ZXeDD6Efg1OkMCBHYSJguf whdFbz/B75Fg1Qt1H63SBAXRz4q0UBaFPpdKYHMMhF7p2xdtQSUKCoT0Y/4EaEfYYkQ/ sddOqvv+723kuLPTcB6wwPzj9KeCIjcnfG2mjpmGxc32DXhpzQQZsL2AJIFJjHP/u3rP +raA== X-Gm-Message-State: APt69E1kiowlwBPDcyXhnXNaiDRa4kpANIOwM/YBSSj113CLfaG5XgFc lXDmL0VhJjWYf9M+jbcWX61ZNyZLh/WHfQXF0dU= X-Received: by 2002:ab0:1446:: with SMTP id c6-v6mr7525557uae.12.1528572884419; Sat, 09 Jun 2018 12:34:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Sat, 9 Jun 2018 12:34:43 -0700 (PDT) In-Reply-To: References: <20180609163829.30619-1-vasilyev@ispras.ru> From: Andy Shevchenko Date: Sat, 9 Jun 2018 22:34:43 +0300 Message-ID: Subject: Re: [PATCH] staging: rts5208: add check on NULL before dereference To: Sinan Kaya Cc: Anton Vasilyev , Greg Kroah-Hartman , Johannes Thumshirn , Gaurav Pathak , Hannes Reinecke , devel@driverdev.osuosl.org, Linux Kernel Mailing List , ldv-project@linuxtesting.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 9, 2018 at 7:58 PM, wrote: > On 2018-06-09 12:38, Anton Vasilyev wrote: >> >> If rtsx_probe fails to allocate dev->chip, then NULL pointer >> dereference occurs at rtsx_release_resources(). >> >> Patch adds checks chip on NULL before its dereference at >> rtsx_release_resources and passing with dereference inside >> rtsx_release_chip. >> >> Found by Linux Driver Verification project (linuxtesting.org). > I think you should bail out if dev->chip is null rather than adding > conditiinals. I'm wondering if it's false positive. At which circumstances that may happen? -- With Best Regards, Andy Shevchenko