Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbcKHRRN (ORCPT ); Tue, 8 Nov 2016 12:17:13 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:40951 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750869AbcKHRRK (ORCPT ); Tue, 8 Nov 2016 12:17:10 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=syeh@vmware.com; Date: Tue, 8 Nov 2016 09:15:57 -0800 From: Sinclair Yeh To: Ravikant Bijendra Sharma CC: , , , , , shailesh pandey , Subject: Re: [PATCH] drm/vmwgfx : Fix NULL pointer comparison Message-ID: <20161108171557.GB3034@promb-2n-dhcp150.eng.vmware.com> References: <1478606431-19101-1-git-send-email-ravikant.s2@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1478606431-19101-1-git-send-email-ravikant.s2@samsung.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: BY1PR0201CA0040.namprd02.prod.outlook.com (10.160.191.178) To DM5PR05MB3241.namprd05.prod.outlook.com (10.173.220.7) X-MS-Office365-Filtering-Correlation-Id: ac5bd3ac-6830-409e-e7c5-08d407faec03 X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3241;2:9JUxLhoorrzYp17goMLcKwDmlp8S7TrnaZ8ZMLgttiTpOzKDK62A/fiBVRTlp6S45OF0u9qxtiQYciYASg3nLVcdVJWF2iDdprs3vH/H738odK6yeBbo9PE41JuEf0bYWLw4mDqF9Pt9FWTpxIu/io9XKca4FYaSGZl4HE8I67FNkKR+/NAoksIvZOSW7g7ToGwaR8Ey+xtbGdHjlps62Q==;3:h187lgIzdEN0NVQFXySDCMcFcxoK7fKt7EQoutmR7aGGx9MpYPzWeAuWiKMEZaxlGSTXNJSYLmJ3UQ75ThHnnN6fqMzkRzaK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2FQu5NkiFLrayal1agPv3NEZHyp4UUzB50LnJ/IwVLoFKB4zVoToRwDtr7HbOVV7BrD9xrtIgi0u2hei8iL13rKhEF8rAR/jrAbDfCqKi3qKou71eDy25PsGHY5yGupDY4qHTHtS2q7HWvm1UMJ6HIkecOTpdzzumyPL+oj7W0WPQE2rV1FjQGzgFYRTRjKt12tvq3O5SHnn+nb7aaox7alYkHAQ/pQK5Hm26Qq1v5O9D6PxWOIYo7qdHRbCtJT9CbZW9RkDwp/bta7juocFt/nnWUIf9DE+PzVZbny4XS9zJFCQZmv/PeoDciIQFW5UWZfOPg6hYLvhy+tfla3q26WcAqFU48amCd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(788757137089)(7411616537696); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DM5PR05MB3241;BCL:0;PCL:0;RULEID:;SRVR:DM5PR05MB3241; X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3241;4:imZHkc8GrXvp3siwOEQM+C2UhqwHtCKzCJImWEmvC/LqxVOAvpb51WNutBilpR+a4WzAYnZXXfTJCM/NmhY5xXunOdKFkypLDVaT/r73B8DfwgLkTL4SIuRYSMfWkZdiJh13Vzh9r/BL10HAdaRokQ7ERXYdMlBoAGPM5NckWsGVZ4LsmU+j9LHX8EgdmldSeqLYG/YzMyAY7seBdssNgg8zMfOi2x3ARhdGDtEGDcpDrPGIjnjGHZzUtcFzF5dWZ2zRx+w6JWMTmasbzoSvO6YARTg83DaH9lPry5DURx9FD2mfUecx+UY3BW6xdygCPc0/+SSa1l5M4NLYzqEdInY3ZQaisE8NxTMAKSqTBqYFMzJ9VMxspHNyrvG3iBFeLfv6nQQKSdKxuEq3K4BQIcUGt+9L6cnM52JrKk0bKjzfY6MVfR1pO3aWMcbXUcVM0HQpemU+j2RLiQPw5N94jtvfZx6wTjFLPN+Cd64Dy9W/dk7iuP4F+eODOF9K2reu X-Forefront-PRVS: 01208B1E18 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(24454002)(189002)(199003)(586003)(6916009)(106356001)(101416001)(305945005)(4001350100001)(97736004)(7736002)(77096005)(47776003)(6116002)(3846002)(1076002)(189998001)(66066001)(83506001)(46406003)(7846002)(50466002)(86362001)(92566002)(575784001)(6666003)(97756001)(4326007)(68736007)(8676002)(2950100002)(105586002)(23726003)(81156014)(5660300001)(76176999)(2906002)(50986999)(81166006)(110136003)(42186005)(33656002)(54356999)(7099028)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR05MB3241;H:promb-2n-dhcp150.eng.vmware.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR05MB3241;23:U4OaheVOkQbEn7WAcbTV1foX9ztFnXcUXtAqB+rTG?= =?us-ascii?Q?csGoJSlQ6eX+3zQOH3OCB8ynldsBrByLSleCZtoT4Xoqv+mmTK+ZGaiyIn5u?= =?us-ascii?Q?1MmhkkORuQKTD1OR9P52vZ98chH7uLZiXTfEuCD5SbzqVq8lMrpzbKe3TE86?= =?us-ascii?Q?wuSLCXpTRK0P436rrAa6OOCCDD2ga8fCDWbyqtpqdZOn6jUB3Dng7S0padHK?= =?us-ascii?Q?g8xnouYbUaGYVQxnuc1sMiDeeDX9vY/N2RoQREow0iub/E7F+wwqZxNMzJd4?= =?us-ascii?Q?CmuenI/Wd/7dihOqzLbSeVDdei1SvCcAUXx38MgEw6jjjkBCfwb8ciemSyA/?= =?us-ascii?Q?CGlaqQgojOMim+53rgsueTp5EAy55wHMOBjaN/p05RNTyqKMRQu7QlsyhBiw?= =?us-ascii?Q?xHv8tKrhHazsFaQkS9XgQ4VaHGSjh6zxR6HgSZIi0k4Aj6ULJmcIYzsQCCVt?= =?us-ascii?Q?KgR+KaIl447UApezPaS2nYXunsw95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MgsQb3lwBLmYuFkQwbBoCgYSC6JWMHkZQGSP1aO0VzEHianSruBt1aGd1qILHx4qhCLZdMRy1hjmwMTL6sF5GHpjgr4lTliZtcX9+rWlqGp8IDct/ZgMnCsmydfWQa;5:5/rescoC1QyX8pUGjdQ/CHqYrk3dV0hXC5wyVajcxdJepsRFXL1X9RCMAvnsI8o8nW2IASTENzWTr5aL0mQfywkPknKPg/g6fnoqnTIqkFmPnbsyIDLpvVM9oQIFWZcbg4GIcuOIjQTMMr4PVL6nvA==;24:yAKhqFRd/olYpAeo0P0EbnW1CoQ2cvgD4CwToNymXr+dIAovIpUKOBWEvLHK9orm4gDaXQKMwxjbW+NnkfGWNJLRVt+Nbgd1XWyyShqBH0Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR05MB3241;7:D6poZQ4i9zILY6Elo/C5CaO+D1NgDBlDPhd7cgnh/Z4Rz+PIR2pLDBas8ooQOr0h9AKmvHJneVPSRQc9OPttqWjAO8DG4FoFDtgpE6XfkFgL9czzpWl2IUI6LzrJvtDyZTb86toEgAO8O/IjDGIvjOFqgj/17bC2QaVQU2AmvxRKwFLkfVdx11CX2txaVXeYrA6E2ebHYCqmMQhMW4gnYMJA4D0RSPCezayAUORxlMA2kunUgGIDhZ8SpopKzyKYl7Vg3AVm/inhDljfJ4s5pQkzofprHueNw40WgbZwZN5Fj7XuO6Xqx9GYRzBiAklrtHg/Z69wKnYPNy2KXx7z5GztI8FVa9OgUZW+QHnbbAo=;20:ily0waLSSv3R+u5jDgy68LnwjlKX63ipZjzGOdhFIOeNdsIsOR3J4z9G8lGhRcjKWpNtwDD4tlCGor1uWF8Lt1A/b2F3Qw1W1qkJ6Pt4dwMzhRPdZoM0O8FUPbU4kYYu5g/MnffOIA9COP84P1JI6snFWioEFpfayS0efOceUrQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2016 17:16:04.0212 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3241 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 12208 Lines: 328 Thanks! Reviewed-by: Sinclair Yeh On Tue, Nov 08, 2016 at 05:30:31PM +0530, Ravikant Bijendra Sharma wrote: > From: Ravikant B Sharma > > Replace direct comparisons to NULL i.e. > 'x == NULL' with '!x'. As per coding standard. > > Signed-off-by: Ravikant B Sharma > --- > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 ++-- > drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 2 +- > drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 2 +- > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++--- > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++-- > drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 10 +++++----- > drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2 +- > drivers/gpu/drm/vmwgfx/vmwgfx_mob.c | 6 +++--- > drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +++--- > drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 6 +++--- > drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- > drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 6 +++--- > 12 files changed, 28 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c > index 13db8a2..133c8bd 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c > @@ -205,7 +205,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, > int ret; > > cres = kzalloc(sizeof(*cres), GFP_KERNEL); > - if (unlikely(cres == NULL)) > + if (unlikely(!cres)) > return -ENOMEM; > > cres->hash.key = user_key | (res_type << 24); > @@ -291,7 +291,7 @@ struct vmw_cmdbuf_res_manager * > int ret; > > man = kzalloc(sizeof(*man), GFP_KERNEL); > - if (man == NULL) > + if (!man) > return ERR_PTR(-ENOMEM); > > man->dev_priv = dev_priv; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c > index 443d1ed..1a46b18 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c > @@ -776,7 +776,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, > } > > ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); > - if (unlikely(ctx == NULL)) { > + if (unlikely(!ctx)) { > ttm_mem_global_free(vmw_mem_glob(dev_priv), > vmw_user_context_size); > ret = -ENOMEM; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c > index 265c81e..8751805 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c > @@ -583,7 +583,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv, > return ERR_PTR(ret); > > vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL); > - if (unlikely(vcotbl == NULL)) { > + if (unlikely(!vcotbl)) { > ret = -ENOMEM; > goto out_no_alloc; > } > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > index 18061a4..8a269db 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > @@ -625,7 +625,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) > char host_log[100] = {0}; > > dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); > - if (unlikely(dev_priv == NULL)) { > + if (unlikely(!dev_priv)) { > DRM_ERROR("Failed allocating a device private struct.\n"); > return -ENOMEM; > } > @@ -1029,7 +1029,7 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv) > int ret = -ENOMEM; > > vmw_fp = kzalloc(sizeof(*vmw_fp), GFP_KERNEL); > - if (unlikely(vmw_fp == NULL)) > + if (unlikely(!vmw_fp)) > return ret; > > vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10); > @@ -1186,7 +1186,7 @@ static int vmw_master_create(struct drm_device *dev, > struct vmw_master *vmaster; > > vmaster = kzalloc(sizeof(*vmaster), GFP_KERNEL); > - if (unlikely(vmaster == NULL)) > + if (unlikely(!vmaster)) > return -ENOMEM; > > vmw_master_init(vmaster); > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > index c7b53d9..2154257 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c > @@ -264,7 +264,7 @@ static int vmw_resource_val_add(struct vmw_sw_context *sw_context, > } > > node = kzalloc(sizeof(*node), GFP_KERNEL); > - if (unlikely(node == NULL)) { > + if (unlikely(!node)) { > DRM_ERROR("Failed to allocate a resource validation " > "entry.\n"); > return -ENOMEM; > @@ -452,7 +452,7 @@ static int vmw_resource_relocation_add(struct list_head *list, > struct vmw_resource_relocation *rel; > > rel = kmalloc(sizeof(*rel), GFP_KERNEL); > - if (unlikely(rel == NULL)) { > + if (unlikely(!rel)) { > DRM_ERROR("Failed to allocate a resource relocation.\n"); > return -ENOMEM; > } > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > index 26ac8e8..f3be51a 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c > @@ -284,7 +284,7 @@ struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv) > { > struct vmw_fence_manager *fman = kzalloc(sizeof(*fman), GFP_KERNEL); > > - if (unlikely(fman == NULL)) > + if (unlikely(!fman)) > return NULL; > > fman->dev_priv = dev_priv; > @@ -541,7 +541,7 @@ int vmw_fence_create(struct vmw_fence_manager *fman, > int ret; > > fence = kzalloc(sizeof(*fence), GFP_KERNEL); > - if (unlikely(fence == NULL)) > + if (unlikely(!fence)) > return -ENOMEM; > > ret = vmw_fence_obj_init(fman, fence, seqno, > @@ -606,7 +606,7 @@ int vmw_user_fence_create(struct drm_file *file_priv, > return ret; > > ufence = kzalloc(sizeof(*ufence), GFP_KERNEL); > - if (unlikely(ufence == NULL)) { > + if (unlikely(!ufence)) { > ret = -ENOMEM; > goto out_no_object; > } > @@ -939,7 +939,7 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv, > struct vmw_fence_manager *fman = fman_from_fence(fence); > > eaction = kzalloc(sizeof(*eaction), GFP_KERNEL); > - if (unlikely(eaction == NULL)) > + if (unlikely(!eaction)) > return -ENOMEM; > > eaction->event = event; > @@ -975,7 +975,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv, > int ret; > > event = kzalloc(sizeof(*event), GFP_KERNEL); > - if (unlikely(event == NULL)) { > + if (unlikely(!event)) { > DRM_ERROR("Failed to allocate an event.\n"); > ret = -ENOMEM; > goto out_no_space; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c > index 170b61b..0335247 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c > @@ -121,7 +121,7 @@ static int vmw_gmrid_man_init(struct ttm_mem_type_manager *man, > struct vmwgfx_gmrid_man *gman = > kzalloc(sizeof(*gman), GFP_KERNEL); > > - if (unlikely(gman == NULL)) > + if (unlikely(!gman)) > return -ENOMEM; > > spin_lock_init(&gman->lock); > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c > index b6126a5..78bec482 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c > @@ -320,14 +320,14 @@ int vmw_otables_setup(struct vmw_private *dev_priv) > > if (dev_priv->has_dx) { > *otables = kmalloc(sizeof(dx_tables), GFP_KERNEL); > - if (*otables == NULL) > + if (!(*otables)) > return -ENOMEM; > > memcpy(*otables, dx_tables, sizeof(dx_tables)); > dev_priv->otable_batch.num_otables = ARRAY_SIZE(dx_tables); > } else { > *otables = kmalloc(sizeof(pre_dx_tables), GFP_KERNEL); > - if (*otables == NULL) > + if (!(*otables)) > return -ENOMEM; > > memcpy(*otables, pre_dx_tables, sizeof(pre_dx_tables)); > @@ -408,7 +408,7 @@ struct vmw_mob *vmw_mob_create(unsigned long data_pages) > { > struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL); > > - if (unlikely(mob == NULL)) > + if (unlikely(!mob)) > return NULL; > > mob->num_pages = vmw_mob_calculate_pt_pages(data_pages); > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > index e57a0ba..59d3fd5 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c > @@ -244,7 +244,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg, > > reply_len = ebx; > reply = kzalloc(reply_len + 1, GFP_KERNEL); > - if (reply == NULL) { > + if (!reply) { > DRM_ERROR("Cannot allocate memory for reply\n"); > return -ENOMEM; > } > @@ -340,7 +340,7 @@ int vmw_host_get_guestinfo(const char *guest_info_param, > > msg_len = strlen(guest_info_param) + strlen("info-get ") + 1; > msg = kzalloc(msg_len, GFP_KERNEL); > - if (msg == NULL) { > + if (!msg) { > DRM_ERROR("Cannot allocate memory to get %s", guest_info_param); > return -ENOMEM; > } > @@ -400,7 +400,7 @@ int vmw_host_log(const char *log) > > msg_len = strlen(log) + strlen("log ") + 1; > msg = kzalloc(msg_len, GFP_KERNEL); > - if (msg == NULL) { > + if (!msg) { > DRM_ERROR("Cannot allocate memory for log message\n"); > return -ENOMEM; > } > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c > index 52ca1c9..35eff0d 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c > @@ -489,7 +489,7 @@ int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv, > int ret; > > user_bo = kzalloc(sizeof(*user_bo), GFP_KERNEL); > - if (unlikely(user_bo == NULL)) { > + if (unlikely(!user_bo)) { > DRM_ERROR("Failed to allocate a buffer.\n"); > return -ENOMEM; > } > @@ -919,7 +919,7 @@ int vmw_stream_claim_ioctl(struct drm_device *dev, void *data, > } > > stream = kmalloc(sizeof(*stream), GFP_KERNEL); > - if (unlikely(stream == NULL)) { > + if (unlikely(!stream)) { > ttm_mem_global_free(vmw_mem_glob(dev_priv), > vmw_user_stream_size); > ret = -ENOMEM; > @@ -1090,7 +1090,7 @@ static int vmw_resource_buf_alloc(struct vmw_resource *res, > } > > backup = kzalloc(sizeof(*backup), GFP_KERNEL); > - if (unlikely(backup == NULL)) > + if (unlikely(!backup)) > return -ENOMEM; > > ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size, > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c > index f423590..a2cff0b 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c > @@ -228,7 +228,7 @@ static int vmw_sou_backing_alloc(struct vmw_private *dev_priv, > vmw_sou_backing_free(dev_priv, sou); > > sou->buffer = kzalloc(sizeof(*sou->buffer), GFP_KERNEL); > - if (unlikely(sou->buffer == NULL)) > + if (unlikely(!sou->buffer)) > return -ENOMEM; > > /* After we have alloced the backing store might not be able to > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > index 92f8b1d..55788e9 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c > @@ -750,7 +750,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, > } > > ushader = kzalloc(sizeof(*ushader), GFP_KERNEL); > - if (unlikely(ushader == NULL)) { > + if (unlikely(!ushader)) { > ttm_mem_global_free(vmw_mem_glob(dev_priv), > vmw_user_shader_size); > ret = -ENOMEM; > @@ -820,7 +820,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv, > } > > shader = kzalloc(sizeof(*shader), GFP_KERNEL); > - if (unlikely(shader == NULL)) { > + if (unlikely(!shader)) { > ttm_mem_global_free(vmw_mem_glob(dev_priv), > vmw_shader_size); > ret = -ENOMEM; > @@ -980,7 +980,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv, > > /* Allocate and pin a DMA buffer */ > buf = kzalloc(sizeof(*buf), GFP_KERNEL); > - if (unlikely(buf == NULL)) > + if (unlikely(!buf)) > return -ENOMEM; > > ret = vmw_dmabuf_init(dev_priv, buf, size, &vmw_sys_ne_placement, > -- > 1.7.9.5 >