From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D05C43381 for ; Sat, 9 Mar 2019 09:42:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14D5E207E0 for ; Sat, 9 Mar 2019 09:42:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z0wQrwjR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14D5E207E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=the-dreams.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qbO1BJojtOP6uAETLXOl1tc5GZrwa3/anzXB+mnpz8Y=; b=Z0wQrwjRghFikKFNBjDaZQTxi slsf7QFrkXWy3zghKdCl1fjDbm9HEsQ0/7u6facfoxI5TBiyTf2Yz5q4nZEPOuXjzzf2oTJHaXAIz Uvb3nIbqgj8vxeU1TH986xL8ul5r+6IrqzZ5RSZ2iYFy7cfoBwOpH1JFTol9PCzYwp0mol/EuJSLN cf7AU3PPT/HBDUxiuAqKo88LTfSt5LMhdCc4xPiT+EdT9gmy6XOXNpI0TkpvicLrK7g2oeOfcVgjp XJ3ohHLanHEBetfnfW6K7q5Jqe6XrXGJTSSptlZxevvmeqAOqcVT9OuYXm1u11QjzWrY7xRVcOoCU 4Nx+73t9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2YVC-0007tj-QZ; Sat, 09 Mar 2019 09:42:46 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2YV8-0007ry-Cd; Sat, 09 Mar 2019 09:42:44 +0000 Received: from localhost (p5486CD1C.dip0.t-ipconnect.de [84.134.205.28]) by pokefinder.org (Postfix) with ESMTPSA id 55DB12E3551; Sat, 9 Mar 2019 10:42:37 +0100 (CET) Date: Sat, 9 Mar 2019 10:42:36 +0100 From: Wolfram Sang To: Hsin-Yi Wang Subject: Re: [PATCH] i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf() Message-ID: <20190309094236.GA1340@kunai> References: <20190215090202.157100-1-hsinyi@chromium.org> MIME-Version: 1.0 In-Reply-To: <20190215090202.157100-1-hsinyi@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190309_014242_577508_21FD5366 X-CRM114-Status: UNSURE ( 7.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ryder Lee , Jun Gao , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-i2c@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0587128818285975164==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0587128818285975164== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 15, 2019 at 05:02:02PM +0800, Hsin-Yi Wang wrote: > i2c_get_dma_safe_msg_buf() allocates space based on msg->len. If threshol= d is > 0 and msg->len is also 0, function makes zero-length allocation, which re= turns > a special ZERO_SIZE_PTR instead of a NULL pointer, and this will cause la= ter > code to fail. Modify the threshold to > 0 so the function returns NULL po= inter. >=20 > Fixes: fc66b39fe36a ("i2c: mediatek: Use DMA safe buffers for i2c transac= tions") > Signed-off-by: Hsin-Yi Wang Reworded commit message to "HW doesn't support 0 length" and applied to for-current, thanks! --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlyDioMACgkQFA3kzBSg KbZAhw//VvjmWX2V1D7BqMoYtsWT9g6U9UWiy4+ovG8ttogdHVOKkDfaHp2IT58Y sQced8n/GBZv4x9a7tK4zXazCOI0zNbUqXWfv4WPqqXCp15wNdG6MzokU1hnTGE8 WuTbXkgS5f/l+r18+bqwsuuk/0kMZ0NH+226y5BJQo9/f3mWefXNX5lgMumsN9P0 ple/6Oy6GS3bL7QyncE9aiMBJoJnjvpNnQBjVfvUt12yGtrDZvdQR5zQxwvDJMXw oCtZtioGZndbsnBKqozPm5XtlKPrsCPeiHorrIZiOreccerL3ORkmMZgGJo1urRs Uic7hyPiQ68SE5mbpzRer8GTZ19EhDNOyMEaoscYOQvlCiU3hcMijUJs/eKx0R04 SbU0Cwr1Bg1XD8pYvWOrf5rDeig1MEpknyZFguvcwJr14nB6d1ul05djL3K3ywJt xUdrQgScWddJ8Rvj8MSNmxg52FzQHpXeSU1qXPsug7PIB3BCAXHS1gRpU66CZw9q zlYsAIEAXCaeGuIPBvUvnHZyWUL+V/zgOfDvcIIQjdIueGMkTwnT/y2lSHzQRZI2 m0qabT7TEBC8QFAdwxoECWzOB7ImM6DS3xEh2h79lGVtvSU49Su23rU1pT18fUfb Ca9kQqVfssz+3iD5SpkbD33LBBYedi9hV+665sC+DZeHmiXe3/8= =KWi3 -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- --===============0587128818285975164== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0587128818285975164==--