Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp996805imu; Fri, 11 Jan 2019 12:59:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN4USL+8H09Gbt4Y7LM29GsqpGO0WfJAqkPL/xsRQ960KJ7njL7hcQYOkms+N9FlcOdN/xwI X-Received: by 2002:a63:f65:: with SMTP id 37mr14631410pgp.238.1547240350606; Fri, 11 Jan 2019 12:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547240350; cv=none; d=google.com; s=arc-20160816; b=P+Nyhq//Pf5Ykp8Ewomz1o3f4PM3GXtujRislYSnMlBP5e1U7XglMvNvXnx1SiXumf 1IpUGbV6B336scuYPD4OQyIwcSk6o1MLuJmzddbO05Nd3VuOIzoHtXomsm5oVeuIxJcy SSCjj6JlpgU7FlpFt//BsLxSjSvV1vw0P+NbtMUj1Bryvk39oGH1OEXIW9WPwxCWAMlJ /W7Gc7A793xiomFH4yZnmUEtWlJWIP89ZhxIVvqxLLX/im07VIxavnIIrqlGMqKmZhuR 99nsiFXOTV1MWOKqNp0KBrkgqsoY1Lecpe/MPK0h2pzxdD61QWO8hlJOCM6D52/HGFjv WkYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yq4cXQfamzKl0NmCfFm3bOQyw/1goxd1B0CYdDiR2qU=; b=Mj+aGiaCNw0wcu/Ydn0KfvROX8Mfte3B6izHtzrMRb3RRLBGVALPrVuAnVhYzIFzHR DKi9x7ZoJXqldzcGXRHeMp44agqtVNiStDAnnnLpE/0hqeAEIPWFGyrOkxtkfzE7z/4S iNjKNBsqaT7Kl72zar1hY1aXyEPWheoJ8K9p9ythsfvspyLECGcE2qg+hYwABg1A5FXr cGU1iuHe/DhYkgpezhyPqf55ols7tnW9ub3q3vW0F/ryIbEJaFriyuFrJCsDBhJf2IIz yJ/g0K4pIo5HpKgNw9MWCKqUYDwud6nyE8kbixDWLUrQOTrFW5rAlMsR4qWvuAJztAXY 7bcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Nga3n1EL; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn22si58425391plb.19.2019.01.11.12.58.55; Fri, 11 Jan 2019 12:59:10 -0800 (PST) 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=@ti.com header.s=ti-com-17Q1 header.b=Nga3n1EL; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389754AbfAKSGK (ORCPT + 99 others); Fri, 11 Jan 2019 13:06:10 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:44208 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733270AbfAKSFk (ORCPT ); Fri, 11 Jan 2019 13:05:40 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0BI5YPD067756; Fri, 11 Jan 2019 12:05:34 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547229934; bh=Yq4cXQfamzKl0NmCfFm3bOQyw/1goxd1B0CYdDiR2qU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Nga3n1ELy72fOPwpXJu3coMo5VzPCkfqcicBZG5TMX5//LjdjrJNuLJwtaQsHLXgH f5PkI33CoPrxFzNFjNuT4QGsGlcwEQmurvCFnZrO7PPVeZ97iZEBKMbwQhz7dk6aNV xLB7GStCF+npiAqHXylAQr0zhXHqV2le9Kzxd+dY= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0BI5Y3K059316 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Jan 2019 12:05:34 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 11 Jan 2019 12:05:34 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 11 Jan 2019 12:05:34 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0BI5YBU025847; Fri, 11 Jan 2019 12:05:34 -0600 Received: from localhost (uda0226330.dhcp.ti.com [172.22.109.196]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x0BI5XU07756; Fri, 11 Jan 2019 12:05:33 -0600 (CST) From: "Andrew F. Davis" To: Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= CC: , , , "Andrew F . Davis" Subject: [PATCH 11/14] staging: android: ion: Allow heap name to be null Date: Fri, 11 Jan 2019 12:05:20 -0600 Message-ID: <20190111180523.27862-12-afd@ti.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190111180523.27862-1-afd@ti.com> References: <20190111180523.27862-1-afd@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The heap name can be used for debugging but otherwise does not seem to be required and no other part of the code will fail if left NULL except here. We can make it required and check for it at some point, for now lets just prevent this from causing a NULL pointer exception. Signed-off-by: Andrew F. Davis --- drivers/staging/android/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index bba5f682bc25..14e48f6eb734 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -467,7 +467,7 @@ static int ion_query_heaps(struct ion_heap_query *query) max_cnt = query->cnt; plist_for_each_entry(heap, &dev->heaps, node) { - strncpy(hdata.name, heap->name, MAX_HEAP_NAME); + strncpy(hdata.name, heap->name ?: "(null)", MAX_HEAP_NAME); hdata.name[sizeof(hdata.name) - 1] = '\0'; hdata.type = heap->type; hdata.heap_id = heap->id; -- 2.19.1