aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/nodemgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r--drivers/ieee1394/nodemgr.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index c5ace190bfe6..1644e6fd2c89 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1163,6 +1163,7 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
1163 struct unit_directory *ud; 1163 struct unit_directory *ud;
1164 int i = 0; 1164 int i = 0;
1165 int length = 0; 1165 int length = 0;
1166 int retval = 0;
1166 /* ieee1394:venNmoNspNverN */ 1167 /* ieee1394:venNmoNspNverN */
1167 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1]; 1168 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1];
1168 1169
@@ -1176,14 +1177,11 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
1176 1177
1177#define PUT_ENVP(fmt,val) \ 1178#define PUT_ENVP(fmt,val) \
1178do { \ 1179do { \
1179 int printed; \ 1180 retval = add_uevent_var(envp, num_envp, &i, \
1180 envp[i++] = buffer; \ 1181 buffer, buffer_size, &length, \
1181 printed = snprintf(buffer, buffer_size - length, \ 1182 fmt, val); \
1182 fmt, val); \ 1183 if (retval) \
1183 if ((buffer_size - (length+printed) <= 0) || (i >= num_envp)) \ 1184 return retval; \
1184 return -ENOMEM; \
1185 length += printed+1; \
1186 buffer += printed+1; \
1187} while (0) 1185} while (0)
1188 1186
1189 PUT_ENVP("VENDOR_ID=%06x", ud->vendor_id); 1187 PUT_ENVP("VENDOR_ID=%06x", ud->vendor_id);