From patchwork Thu Jan 28 23:54:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Insu Yun X-Patchwork-Id: 8155371 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 492D0BEEE5 for ; Fri, 29 Jan 2016 01:19:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8386420328 for ; Fri, 29 Jan 2016 01:19:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A818520361 for ; Fri, 29 Jan 2016 01:19:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A9B66E8ED; Thu, 28 Jan 2016 17:19:05 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com [209.85.160.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD3696E004 for ; Thu, 28 Jan 2016 15:51:58 -0800 (PST) Received: by mail-yk0-f177.google.com with SMTP id v14so50741410ykd.3 for ; Thu, 28 Jan 2016 15:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=I3NCijO2DLzBceiAbhqeDbvVFGgWYTMlVTJMkXcO5mw=; b=FEr4g5HmR8qwgJfoHkhQNcZUE+77DQ9R4mN10aoK9EeyiS2Sgx//iw0GDN+y0nCpPb Xl+TXnPbQA0EOCMDPbizUKSm5MlOuft88BbfhQy6/b2V/6SJOVg6UwlUVeKNbzBEIser g6/lx3dpeBrFZ5hxvEgJLtRvwsjAg+0mA10B/7UTZXlsMkZOKMxqj6Z8HyBcwJ7w0c6e WL+V6UCVu5g5WC4QrmllOYcxM7MBmnNGIXWve65nO6iKWJnWT/wRAoM7lOwmDHDG7CkO GxJCvLtGklduIMuXqvRrsL1MqCy08oOV+yMok3qVFZBe0URX7thaJO6+zlpz1W1Kk3sm 0DQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=I3NCijO2DLzBceiAbhqeDbvVFGgWYTMlVTJMkXcO5mw=; b=fs077buv2pfn7gWvjNcyTI1z85jdN20aOqzDjpE4k/sR6AaA89cLDPs6Xu/orkln44 4FCH+ucuQSMt/xDCO2cqyiCvmihNpIkXVNLBd6JhybvExtQQtf8wRc+o+FrFVIJpU0TF qt2str+tNEozJArbspdHX7ajhfHslZQcS3gvHI4JvPeGtTAPlXSAWJOLXn7cKjOwPdl9 ZkC9y6J/Ii5nB4thgLLqWDSMwmDbrJG1raw09oc51D4YVpfOb5n9rs3GOcXxVFIt2+2m Z6W2LtUJoFFwWPA2i9y+WtN7PoEVpRLhhoTZcOSxLfPLE0FKZLw4vY6qxKDeBI7rUbep qpWA== X-Gm-Message-State: AG10YOT6vyu8s7gjP4O73j6ENOH814xlJjshapu+54X1mUi0mJfUwMJqPnlPzbDWhXv2tQ== X-Received: by 10.129.37.3 with SMTP id l3mr3053102ywl.128.1454025118081; Thu, 28 Jan 2016 15:51:58 -0800 (PST) Received: from insu.gtisc.gatech.edu (insu.gtisc.gatech.edu. [143.215.130.94]) by smtp.gmail.com with ESMTPSA id u190sm10230442ywd.17.2016.01.28.15.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 15:51:57 -0800 (PST) From: Insu Yun To: airlied@linux.ie, daniel.vetter@ffwll.ch, ville.syrjala@linux.intel.com, alexander.deucher@amd.com, treding@nvidia.com, boris.brezillon@free-electrons.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] ch7006: correctly handling failed allocation Date: Thu, 28 Jan 2016 18:54:36 -0500 Message-Id: <1454025276-13465-1-git-send-email-wuninsu@gmail.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 28 Jan 2016 17:19:04 -0800 Cc: yeongjin.jang@gatech.edu, taesoo@gatech.edu, insu@gatech.edu, Insu Yun , changwoo@gatech.edu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since drm_property_create_range can be failed in memory pressure, it needs to be checked and return -ENOMEM. Signed-off-by: Insu Yun --- drivers/gpu/drm/i2c/ch7006_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 90db5f4..0594c45 100644 --- a/drivers/gpu/drm/i2c/ch7006_drv.c +++ b/drivers/gpu/drm/i2c/ch7006_drv.c @@ -253,6 +253,8 @@ static int ch7006_encoder_create_resources(struct drm_encoder *encoder, drm_mode_create_tv_properties(dev, NUM_TV_NORMS, ch7006_tv_norm_names); priv->scale_property = drm_property_create_range(dev, 0, "scale", 0, 2); + if (!priv->scale_property) + return -ENOMEM; drm_object_attach_property(&connector->base, conf->tv_select_subconnector_property, priv->select_subconnector);