From patchwork Thu Feb 22 17:07:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code AI X-Patchwork-Id: 876775 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mycode-ai.20150623.gappssmtp.com header.i=@mycode-ai.20150623.gappssmtp.com header.b="EaNYKmLJ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3znLRM2QPyz9s0W for ; Fri, 23 Feb 2018 04:08:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933193AbeBVRIp (ORCPT ); Thu, 22 Feb 2018 12:08:45 -0500 Received: from mail-yw0-f195.google.com ([209.85.161.195]:44086 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933139AbeBVRIc (ORCPT ); Thu, 22 Feb 2018 12:08:32 -0500 Received: by mail-yw0-f195.google.com with SMTP id x197so1657358ywg.11 for ; Thu, 22 Feb 2018 09:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mycode-ai.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=6ha/JFZFiHx/gVF4HJ03qR7UiIIkWkBL5OXJrr2l2pw=; b=EaNYKmLJnVSTNfTGYhtute/pfVtn3W3sdrMc8YjwE4GbcrWENTX18HjH0mBF+r5aDg hyVY/XNJwPBOyfZJlAyqpf3bIRXgzgkO9KhrR7tdJH7QgHywkBUxMqa7N+R/XrCp6RK6 ExDDiciZi5hvHM0VNQ2UbE1j9LjwkH9aqwWn8kZ3HV8fw4lSLa30UtyficdAfGos/UO7 kwJDyTClF58mIF+UPRREfognCfs0ieWyekLKU8qTMtWsMl5x/Y9V7Dfrdotq+ZtuTI97 RIlwaK48jHt1Z9tc23Bq+zmW0X1bD7HTm5n5CNzR07nZJAp8Fqk5BnCyrLjAC8rb02bi AGGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=6ha/JFZFiHx/gVF4HJ03qR7UiIIkWkBL5OXJrr2l2pw=; b=iZt5WCOr6M4ORHBN7oOQEkwQ/B4DLwiUO2Zebd8LWVfQjhasN9kLSzvy3bCUwl+ZBY +UEAruRU6oPdI7xPM3Lsidi7bcE8WNsPfQ/Ld0VTMMq/IAUDEdJ79+BHckNyttFGSbbU BhQ9HNbxAOdzzpbcgqBn8Hij/NKBeymLahTLmpK7XJbHcnegJ5ENZ++XHRTXPh3PmS/O cOETysioKuYu1H35gJI4sNyc3u2OikHRNliWafJGj5kwyz4WUyL66Yqmg6/AQNCzjACp rV0zbWGUwVOK61AYApi/F2ZJAebvlI5GSjJTKrs2ouR+FQor20lNGSsO3Qi0LqjhOcJ6 mJfA== X-Gm-Message-State: APf1xPBRMrfI0P0bG2HWArbVewK5km2aPeogNWFqwJ2DwGZNfC7AP2Om nu3NQSCXoZOITOwSiBLMrwhh5xz6I+k= X-Google-Smtp-Source: AH8x224+fkxrQ3aQ9Iq2TSKlSTkeRYqadUSGvxvRnVG60npQ9Vub94A07GMFBY64uUqN9ICfD6w6DA== X-Received: by 10.13.219.79 with SMTP id d76mr5149304ywe.182.1519319311521; Thu, 22 Feb 2018 09:08:31 -0800 (PST) Received: from paul-desktop.hsd1.ga.comcast.net (96-87-228-86-static.hfc.comcastbusiness.net. [96.87.228.86]) by smtp.gmail.com with ESMTPSA id k2sm193631ywi.52.2018.02.22.09.08.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Feb 2018 09:08:30 -0800 (PST) From: C0deAi X-Google-Original-From: C0deAi To: tj@kernel.org, linux-ide@vger.kernel.org Subject: [PATCH] ata: Prevent null dereference in ata_host_alloc_pinfo Date: Thu, 22 Feb 2018 12:07:51 -0500 Message-Id: <1519319271-30139-1-git-send-email-benjamin.bales@assrc.us> X-Mailer: git-send-email 2.7.4 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hi my name is Benjamin Bales. I am the founder and creator of CodeAI, the first non-human contributor to your software project. CodeAI finds and fixes security defects for you. It fixed 327. It wants to merge a null pointer dereference fix. To view all 327 fixed issues from the run claim your free open source account at mycode.aiand the Dockerfile used to build and run your project in CodeAI, here- https://drive.google.com/drive/folders/1KB9WQQyWQgYccmiSjy2E1JWJ4vWuoLYd . It is always free for open source projects. If you have any questions about these results or have general inquiries about CodeAI, please send an email to techsupport@mycode.ai Signed-off-by: Benjamin Bales --- drivers/ata/libata-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3c09122..e0b0df7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6129,6 +6129,9 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, if (ppi[j]) pi = ppi[j++]; + if (pi == NULL) + break; + ap->pio_mask = pi->pio_mask; ap->mwdma_mask = pi->mwdma_mask; ap->udma_mask = pi->udma_mask;